Message309919
There some subtle differences.
1. Unlike to LOAD_NAME, STORE_ANNOTATION doesn't fall back to globals if '__annotations__' is not found in locals. The behavior difference is shown by the following example:
x: int
class A:
del __annotations__
y: int
2. The single STORE_ANNOTATION is faster than 3 other opcodes.
3. It doesn't add a name constant. Instead it uses a name from the names list (which already has to contain this name). |
|
| Date |
User |
Action |
Args |
| 2018-01-14 12:30:18 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, Mark.Shannon, yselivanov, levkivskyi |
| 2018-01-14 12:30:18 | serhiy.storchaka | set | messageid: <[email protected]> |
| 2018-01-14 12:30:18 | serhiy.storchaka | link | issue32550 messages |
| 2018-01-14 12:30:17 | serhiy.storchaka | create | |
|