Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b016da3

Browse files
committed
Update. __dict__ assignment done. Reorder remaining "to do" items by
priority. Add tp_cache; add some comments to others.
1 parent 6661be3 commit b016da3

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

PLAN.txt

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,45 @@
11
Project: core implementation
22
****************************
33

4-
Still to do
5-
-----------
6-
7-
Add __del__ handlers?
4+
Still to do (by priority)
5+
-------------------------
86

9-
Allow assignment to __bases__ and __dict__?
7+
Add __del__ handlers? I asked for a motivation on python-dev and
8+
nobody piped up. Yet I expect it will be asked for later. Are there
9+
GC issues? Doesn't the GC make an exception for classic classes with
10+
a __del__ handler?
1011

1112
Support mixed multiple inheritance from classic and new-style classes?
13+
That would be cool and make new-style classes much more usable (it
14+
would remove most of the reasons not to use them for new projects).
15+
How hard would this be?
16+
17+
Do something with the tp_cache slot? This is (was?) intended to cache
18+
all the class attributes from all base classes; a key would be deleted
19+
when the base class attribute is. But the question is, are the
20+
savings worth it? So I may not do this.
1221

1322
Check for conflicts between base classes. I fear that the rules used
1423
to decide whether multiple bases have conflicting instance variables
1524
aren't strict enough. I think that sometimes two different classes
16-
adding __dict__ may be incompatible after all.
25+
adding __dict__ may be incompatible after all. (I may not do this.
26+
Who cares.)
1727

1828
Check for order conflicts. Suppose there are two base classes X and
1929
Y. Suppose class B derives from X and Y, and class C from Y and X (in
2030
that order). Now suppose class D derives from B and C. In which
2131
order should the base classes X and Y be searched? This is an order
2232
conflict, and should be disallowed; currently the test for this is not
23-
implemented.
33+
implemented. (I may not do this. Who cares.)
34+
35+
Allow assignment to __bases__? (I don't think there's a demand for
36+
this.)
2437

2538
Done (mostly)
2639
-------------
2740

41+
Assignment to __dict__.
42+
2843
More performance work -- one particular test, test_descr.inherits(),
2944
is still about 50% slower with dynamic classes. :-( The approach of
3045
choice would be:

0 commit comments

Comments
 (0)