Message6864
Logged In: YES
user_id=31435
This is deliberate. If, e.g., you don't override the
slicing operator in Test, then t[:] is handled by the base
class's slicing operator. The base class can't know what
invariants Test needs to preserve, so does the best it can
by constructing a list. If you want operators that return
Test instances instead, you have to supply them.
Note that base-class operators *sometimes* returned
instances of subclasses in earlier 2.2 alphas, but
unpredictably (depending on internal optimizations). This
was properly reported as a bug, and was fixed for 2.2a4;
see bug 460020 for details. |
|
Date |
User |
Action |
Args |
2007-08-23 13:56:44 | admin | link | issue468887 messages |
2007-08-23 13:56:44 | admin | create | |
|