Quick questions: Is mmap's inability to be subclassed a feature or bug? Is one's inability to use a = mmapinstance.__setslice__;a(1,2,'a') (and others) a feature or bug? I would imagine they are bugs, but I just wanted to make sure and post the report/request in the proper location. Thank you, - Josiah
Josiah Carlson wrote:
Is mmap's inability to be subclassed a feature or bug?
No. It's a missing feature: it's not a bug, because nobody says this should work, and anybody trying will find out that it doesn't work, so nobody is tricked into believing it should work. The mmap type is not even documented; mmap.mmap is a function. It's not a feature, because (atleast IMO) there would be nothing wrong with making mmap.mmap a subclassable type.
Is one's inability to use a = mmapinstance.__setslice__;a(1,2,'a') (and others) a feature or bug?
That is a bug. Slice assignments are supported, and so should __setslice__. Regards, Martin
Josiah Carlson <jcarlson@uci.edu> writes:
Quick questions: Is mmap's inability to be subclassed a feature or bug?
Like Martin said, a missing feature. I'd also quite like the mmap module to have a C API, but as my use case is especially evil ( http://starship.python.net/crew/mwh/hacks/PPY.html ) I'm not going to push that hard :)
Is one's inability to use a = mmapinstance.__setslice__;a(1,2,'a') (and others) a feature or bug?
I'm not entirely sure about this, though. Does mmapinstance.__setitem__(slice(1,2), 'a') work? AIUI __setslice__ and __getslice__ are out of favour these days (not sure though). Any patch to fix one of these would probably also fix the other almost as a sside-effect... Cheers, mwh -- ... with these conditions cam the realisation that ... nothing turned a perfectly normal healthy individual into a great political or military leader better than irreversible brain damage. -- The Hitch-Hikers Guide to the Galaxy, Episode 11
Michael Hudson <mwh@python.net> wrote:
Josiah Carlson <jcarlson@uci.edu> writes:
Is one's inability to use a = mmapinstance.__setslice__;a(1,2,'a') (and others) a feature or bug?
I'm not entirely sure about this, though. Does
mmapinstance.__setitem__(slice(1,2), 'a')
work? AIUI __setslice__ and __getslice__ are out of favour these days (not sure though).
Any patch to fix one of these would probably also fix the other almost as a sside-effect...
Accessing mmapi.__setslice__, mmapi.__getslice__, mmapi.__getitem__ and mmapi.__setitem__ fail with attribute errors. - Josiah
participants (3)
-
"Martin v. Löwis"
-
Josiah Carlson
-
Michael Hudson