EmilyDirsh / hotwire-shell

Automatically exported from code.google.com/p/hotwire-shell
Other
0 stars 0 forks source link

Fix __streamtype_is_assignable to handle multiple levels of inheritance #147

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
__streamtype_is_assignable handles the case where out_spec is a direct 
subclass of in_spec but not if there are multiple levels of inheritance 
(hence otherwise valid pairings will be rejected).

Seen whilst hacking on an extension under 0.710, looks like it occurs 
under SVN also, by inspection of the code.

I've briefly used this on 0.710 and it allowed my extension (which adds a 
subtype of files) to work.  I made the patch apply to SVN without user 
testing, although I ran through the test-hotwire script (one test failed, 
but it failed without my patch already).

Please consider applying.

Cheers,
Mark

Original issue reported on code.google.com by lemmingm...@gmail.com on 11 Feb 2008 at 3:14

Attachments:

GoogleCodeExporter commented 9 years ago
Looks great, thank you!

Committed r1030
    M   hotwire/command.py
r1030 = 05e017a966cfc67831d6f026a0f304d6f0a2cee1 (git-svn)

Original comment by cgwalt...@gmail.com on 11 Feb 2008 at 6:57

GoogleCodeExporter commented 9 years ago
For the record, my patch was inspired by 
http://mail.python.org/pipermail/python-list/2002-November/173949.html
which also handles both old and new-style classes.  Didn't look necessary to do 
this in Hotwire.  I also used a list not a dict, on the grounds that the 
inheritance trees are going to be small anyhow.

Thanks for seeing to it so quickly!  I'm really liking working on plugin stuff, 
I'll try and post some information about my plugin in the hotwire group, 
presently, 
as I think it's an interesting leverage of the available magic ;-)

Original comment by lemmingm...@gmail.com on 11 Feb 2008 at 4:24