summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-10-03 03:00:56 (GMT)
committerGuido van Rossum <guido@python.org>2001-10-03 03:00:56 (GMT)
commitf49a91340a22d89bea4f0566500d5f954f35c744 (patch)
treeed734d7fe7493de49eeb7d65f56c7d0acbbd6a2c
parentda21c0110b1948d4b3e0593e06436a2a5582f366 (diff)
downloadcpython-f49a91340a22d89bea4f0566500d5f954f35c744.zip
cpython-f49a91340a22d89bea4f0566500d5f954f35c744.tar.gz
cpython-f49a91340a22d89bea4f0566500d5f954f35c744.tar.bz2
Mark treatment of binary operators for __rop__-before-__op__ as done.
Add more detail about the speed optimizations needed for __dynamic__. The weak reference solution becomes more attractive...
-rw-r--r--PLAN.txt20
1 files changed, 15 insertions, 5 deletions
diff --git a/PLAN.txt b/PLAN.txt
index 88999f1..c88511c 100644
--- a/PLAN.txt
+++ b/PLAN.txt
@@ -4,13 +4,19 @@ Project: core implementation
Still to do
-----------
-Treat all binary operators the same way as I just did for rich
-comparison: in a <op> b, if isinstance(b, type(a)), try b.__rop__(a)
-before trying a.__op__(b).
-
Make __dynamic__ the default (this requires more performance work --
one particular test, test_descr.inherits(), is about 10x slower when
-__dynamic__ is 1. :-(
+__dynamic__ is 1. :-( There are two ways to go about the performance
+work:
+
+ a) Add shortcuts to the slot_tp_XXX to recognize a PyWrapperDescr
+ with the correct wrap_tp_XXX function.
+
+ b) Add a list or dict of weak refs to derived classes to each dynamic
+ class, and trap setattr+delattr on the base class so that they
+ update the tp_XXX slot in each derived class when the base class
+ __XXX__ gets set or deleted. More work, but more gain (zero waste
+ in slot_tp_XXX when __XXX__ is not overridden).
Add __del__ handlers.
@@ -33,6 +39,10 @@ implemented.
Done (mostly)
-------------
+Treat all binary operators the same way as I just did for rich
+comparison: in a <op> b, if type(a) is not type(b) and isinstance(b,
+type(a)), try b.__rop__(a) before trying a.__op__(b). *** Done. ***
+
Fix comparisons. There's some nasty stuff here: when two types are
not the same, and they're not instances, the fallback code doesn't
account for the possibility that they might be subtypes of a common