monkey patching __code__

Sven R. Kunze srkunze at mail.de
Fri Mar 18 11:01:37 EDT 2016


On 18.03.2016 15:48, Ian Kelly wrote:
> Well I didn't design it, so I'm not really sure. But it could be argued
> that the defaults are intrinsic to the function declaration, not the code
> object, as not all code objects even have arguments. It also makes it
> straight-forward to create a new function that uses the same code but with
> different defaults or globals.

It occurred to me after I sent that email.

However, changing globals is not possible.


Best,
Sven



More information about the Python-list mailing list