This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Mark.Shannon, gvanrossum, levkivskyi, serhiy.storchaka, yselivanov
Date 2018-01-14.12:30:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1515933018.1.0.467229070634.issue32550@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2018-01-14 12:30:18serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, Mark.Shannon, yselivanov, levkivskyi
2018-01-14 12:30:18serhiy.storchakasetmessageid: <1515933018.1.0.467229070634.issue32550@psf.upfronthosting.co.za>
2018-01-14 12:30:18serhiy.storchakalinkissue32550 messages
2018-01-14 12:30:17serhiy.storchakacreate