A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-December/115107.html below:

[Python-Dev] A new dict for Xmas?

[Python-Dev] A new dict for Xmas? [Python-Dev] A new dict for Xmas?"Martin v. Löwis" martin at v.loewis.de
Fri Dec 23 09:57:01 CET 2011
Am 22.12.2011 19:15, schrieb Maciej Fijalkowski:
>> - I wonder whether the shared keys could be computed at compile
>>  time, considering all attribute names that get assigned for
>>  self. The compiler could list those in the code object, and
>>  class creation could iterate over all methods (taking base
>>  classes into account).
> 
> This is hard, because sometimes you don't quite know what the self
> *is* even, especially if __init__ calls some methods or there is any
> sort of control flow. You can however track what gets assigned at
> runtime at have shapes associated with objects.

Actually, it's fairly easy, as it only needs to be heuristical.
I am proposing the exact heuristics as specified above ("attribute
names that get assigned for self").

I don't think that __init__ calling methods is much of an issue here,
since these methods then still have attributes assigned to self.

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4