Message309922
> 3. It doesn't add a name constant. Instead it uses a name from the names list (which already has to contain this name).
This PR moves the constant for the name from `co_names` to `co_consts`. There is no duplication.
>>> def f():
... class C:
... a : 1
(It does add __annotations__ to `co_names`, but that seems reasonable to me)
Current:
>>> f.__code__.co_consts[1].co_names
('__name__', '__module__', '__qualname__', 'a')
>>> f.__code__.co_consts[1].co_consts
('f.<locals>.C', 1, None)
With PR 5181:
>>> f.__code__.co_consts[1].co_names
('__name__', '__module__', '__qualname__', '__annotations__')
>>> f.__code__.co_consts[1].co_consts
('f.<locals>.C', 1, 'a', None) |
|
Date |
User |
Action |
Args |
2018-01-14 13:18:18 | Mark.Shannon | set | recipients:
+ Mark.Shannon, gvanrossum, serhiy.storchaka, yselivanov, levkivskyi |
2018-01-14 13:18:18 | Mark.Shannon | set | messageid: <1515935898.56.0.467229070634.issue32550@psf.upfronthosting.co.za> |
2018-01-14 13:18:18 | Mark.Shannon | link | issue32550 messages |
2018-01-14 13:18:18 | Mark.Shannon | create | |
|