[docs] Code, test, and doc review for PEP-0435 Enum (issue 17947)

ethan at stoneleaf.us ethan at stoneleaf.us
Mon May 13 20:39:24 CEST 2013


http://bugs.python.org/review/17947/diff/8131/Lib/enum.py
File Lib/enum.py (right):

http://bugs.python.org/review/17947/diff/8131/Lib/enum.py#newcode355
Lib/enum.py:355: return member
On 2013/05/13 20:34:50, alex wrote:
> On 2013/05/13 20:32:37, stoneleaf wrote:
> > On 2013/05/13 19:35:53, alex wrote:
> > > I would have assumed that that creating an enum from a value would
be O(1),
> > not
> > > O(n), is there no way we can improve this?
> > 
> > Sure, but it would add a bunch of complexity, and is it worth it for
a one
> time
> > operation?
> 
> Why do you think it's a one time operation? Everytime you do something
like
> "turn a C errono into an enum" you go through this.

Sorry, saw the __new__ and thought you were talking about the initial
class creation.

I would say this is worth optimizing.  I'll get something in place.

http://bugs.python.org/review/17947/


More information about the docs mailing list