You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A) It's a pun I can't resist
B) The p property can then be monkey patched before it is imported by scripts.
The advertised objects should be factories for callables that take the PythonHocInterpreter as argument. The factories themselves are passed the entire PythonHocModule because they can't import patch (circular import as this entry point is called during import of the patch module).
Patch should also get a submodule monkey with in it a method patch because what's better than a pun? A double pun! And with patch.monkey.patch you should be able to watertightly patch some stuff like all the functions that can start a simulation
The text was updated successfully, but these errors were encountered:
Monkey patching might have adverse effects when patch is used in multiple projects and generally has adverse side effects. Great pun, bad idea.
Instead inheritance to create your own patch.interpreter.PythonHocInterpreter could be used, a type map could be added and all patched wrappers could check if they need to return patch.objects.* or a user defined type instead.
Helveg
changed the title
Facilitate monkey-patching
Facilitate user defined type factories
Sep 13, 2021
Add
patch.monkey
entry point becauseA) It's a pun I can't resist
B) The
p
property can then be monkey patched before it is imported by scripts.The advertised objects should be factories for callables that take the
PythonHocInterpreter
as argument. The factories themselves are passed the entirePythonHocModule
because they can'timport patch
(circular import as this entry point is called during import of the patch module).Patch should also get a submodule
monkey
with in it a methodpatch
because what's better than a pun? A double pun! And withpatch.monkey.patch
you should be able to watertightly patch some stuff like all the functions that can start a simulationThe text was updated successfully, but these errors were encountered: