[Python-Dev] Update on PEP 523 and adding a co_extra field to code objects

Antoine Pitrou solipsis at pitrou.net
Tue Aug 30 13:30:51 EDT 2016


On Tue, 30 Aug 2016 17:14:31 +0000
Brett Cannon <brett at python.org> wrote:
> 
> Depends on what vmprof chooses to do. Since the data is designed to be
> disposable it could decide it should always take precedence and overwrite
> the data if someone beat it to using the field. Basically I don't think we
> want co_extra1, co_extra2, etc. But we don't want to require a dict either
> as that kills performance. Using a list where users could push on objects
> might work, but I have no clue what that would do to perf as you would have
> to still needlessly search the list when only one piece of code uses the
> field.

Perhaps a list would work indeed.  Realistically, if there are at most
2-3 users of the field at any given time (and most probably only one or
zero), a simple type check (by pointer equality) on each list item may
be sufficient.

Speaking about Numba, we don't have any planned use for the field, so I
can't really give any further suggestion.

Regards

Antoine.


More information about the Python-Dev mailing list