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 v2m
Recipients BTaskaya, Mark.Shannon, gvanrossum, rhettinger, v2m
Date 2021-03-22.19:25:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1616441160.53.0.882324988953.issue43563@roundup.psfhosted.org>
In-reply-to
Content
>Currently, super() is decoupled from the core language.  It is just a builtin that provides customized attribute lookup.  This PR makes super() more tightly integrated with the core language, treating it as if it were a keyword and part of the grammar.  Also note, users can currently create their own versions of super(), shadowing the builtin super().

This is true however:
- this patch does not block people from introducing custom version of `super` so this scenario still work. The idea was to streamline the common case
- based on digging into Instagram codebase and its transitive dependencies (which is reasonably large amount of code) all spots where `super()` appear in sources assume `super` to be builtin and for a pretty common use-case its cost is noticeable in profiler.
- zero-argument `super()` still a bit magical since it requires compiler support to create cell for `__class__` and assumes certain shape of the frame object so this patch is a step forward with a better compiler support and removing runtime dependency on the frame

> Do you have any evidence that the overhead of super() is significant in real programs

I do see the non-negligible cost of allocation/initialization of `super` object in IG profiling data.
History
Date User Action Args
2021-03-22 19:26:00v2msetrecipients: + v2m, gvanrossum, rhettinger, Mark.Shannon, BTaskaya
2021-03-22 19:26:00v2msetmessageid: <1616441160.53.0.882324988953.issue43563@roundup.psfhosted.org>
2021-03-22 19:26:00v2mlinkissue43563 messages
2021-03-22 19:25:59v2mcreate