Movatterモバイル変換


[0]ホーム

URL:


homepage

Message239622

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Authorbru
Recipientsbarry, bru, eli.bendersky, ethan.furman, serhiy.storchaka
Date2015-03-30.16:35:05
SpamBayes Score-1.0
Marked as misclassifiedYes
Message-id<CAMA3c4_6xzjS8DQ3i4DjAu+TUt6qFKd3Ys3QEeZcH_QRLOa_GA@mail.gmail.com>
In-reply-to<1427731321.63.0.606134497138.issue23640@psf.upfronthosting.co.za>
Content
I'm not sure how you can have both, those two seem opposite to me:- if 'from_bytes' returns the same type as the class it is called on thenthe instantiation of the result object should go through its constructor(patch proposed)- if the subclass should override base class behaviour then there is noreason for Enum.from_bytes to return the same type as the class it iscalled on, and therefore it should be made a classmethod.2015-03-30 18:02 GMT+02:00 Ethan Furman <report@bugs.python.org>:>> Ethan Furman added the comment:>> 'from_bytes' is a classmethod.  As such, it should return the same type as> the class it is called on.  If that wasn't the intent it would be a> staticmethod instead.>> It is the responsibility of the subclass to override base class behavior,> not the other way around.>> ---------->> _______________________________________> Python tracker <report@bugs.python.org>> <http://bugs.python.org/issue23640>> _______________________________________>
History
DateUserActionArgs
2015-03-30 16:35:05brusetrecipients: +bru,barry,eli.bendersky,ethan.furman,serhiy.storchaka
2015-03-30 16:35:05brulinkissue23640 messages
2015-03-30 16:35:05brucreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp