[Python-ideas] RFC: PEP: Specialized functions with guards

Victor Stinner victor.stinner at gmail.com
Fri Jan 8 20:59:23 EST 2016


2016-01-09 2:42 GMT+01:00 Chris Angelico <rosuav at gmail.com>:
> On Sat, Jan 9, 2016 at 8:31 AM, Victor Stinner <victor.stinner at gmail.com> wrote:
>> When a function is serialized (by ``marshal`` or ``pickle`` for
>> example), specialized functions and guards are ignored (not serialized).
>>
>
> Does this mean that any code imported from a .pyc file cannot take
> advantage of these kinds of optimizations?

Ah yes, this sentence is confusing. It should not mention marshal, it's wrong.

A .pyc file doesn't not contain functions... It only contains code
objects. Functions are only created at runtime.

Specialized functions are also added at runtime.

Victor


More information about the Python-ideas mailing list