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

ethan at stoneleaf.us ethan at stoneleaf.us
Fri May 17 17:40:14 CEST 2013


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

http://bugs.python.org/review/17947/diff/8161/Lib/enum.py#newcode7
Lib/enum.py:7: import weakref
On 2013/05/17 15:37:11, zach.ware wrote:
> As pointed out by Donald Stufft on the issue, weakref is unused.
> 
> (Just to have a comment on it :))

Yeah, I was going to use it, then didn't.  Removed.

http://bugs.python.org/review/17947/diff/8161/Lib/enum.py#newcode37
Lib/enum.py:37: def dunder(name):
On 2013/05/17 15:37:11, zach.ware wrote:
> Might be better named "is_dunder" since you're asking if it is, not
making it
> so.

Done.

http://bugs.python.org/review/17947/diff/8161/Lib/enum.py#newcode52
Lib/enum.py:52: raise TypeError('%r cannot be pickled' % self)
Done.

http://bugs.python.org/review/17947/diff/8161/Lib/enum.py#newcode123
Lib/enum.py:123: "'_find_new' cannot be used for members")
I'd rather not -- seems like it would be easy to miss a trailing
underscore.  Also, in the tuple case the _as_dict method is actually
public -- these aren't.

If we're going to reserve an entire namespace, how about '_somename_' ?

http://bugs.python.org/review/17947/diff/8161/Lib/enum.py#newcode146
Lib/enum.py:146: enum_class.__module__ = 'uh uh'
If you insist. ;)

Went with 'not picklable'.

http://bugs.python.org/review/17947/diff/8161/Lib/test/test_enum.py
File Lib/test/test_enum.py (right):

http://bugs.python.org/review/17947/diff/8161/Lib/test/test_enum.py#newcode2
Lib/test/test_enum.py:2: import sys
On 2013/05/17 15:37:11, zach.ware wrote:
> Turns out sys isn't used here, either.

Done.

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


More information about the docs mailing list