Message191615
> I have no idea what CLOS does in this situation.
No worries, I was just curious whether you knew whether this was a solved problem in Dylan or CLOS or some other language.
When faced with a diamond diagram, what are the semantics for isinstance(super_instance, cls)?
I worked on it for a little bit and came up with the following:
def super_isinstance(super_inst, cls):
'Is the cls in the mro somewhere after the current class?'
mro = super_inst.__self__.__class__.__mro__
thisclass = super_inst.__thisclass__
return cls in mro and mro.index(thisclass) < mro.index(cls) |
|
Date |
User |
Action |
Args |
2013-06-21 22:22:49 | rhettinger | set | recipients:
+ rhettinger, brett.cannon, pitrou, benjamin.peterson |
2013-06-21 22:22:49 | rhettinger | set | messageid: <1371853369.59.0.358455846241.issue18275@psf.upfronthosting.co.za> |
2013-06-21 22:22:49 | rhettinger | link | issue18275 messages |
2013-06-21 22:22:49 | rhettinger | create | |
|