mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Remove support for __members__ and __methods__. There still might be
some cleanup to do on this. Particularly in Python/traceback.c with getting rid of the getattr if possible and Demo/*metaclasses/Enum.py.
This commit is contained in:
parent
32ca442b13
commit
8dfc4a9bac
14 changed files with 83 additions and 195 deletions
|
@ -162,15 +162,7 @@ For instance of built-in types, x.__class__ is now the same as type(x):
|
|||
True
|
||||
>>>
|
||||
|
||||
Under the new proposal, the __methods__ attribute no longer exists:
|
||||
|
||||
>>> [].__methods__
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in ?
|
||||
AttributeError: 'list' object has no attribute '__methods__'
|
||||
>>>
|
||||
|
||||
Instead, you can get the same information from the list type:
|
||||
You can get the information from the list type:
|
||||
|
||||
>>> pprint.pprint(dir(list)) # like list.__dict__.keys(), but sorted
|
||||
['__add__',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue