[issue19995] %c, %o, %x, %X accept non-integer values instead of raising an exception

2014-01-05 Thread Ethan Furman
Ethan Furman added the comment: I'll switch it to a deprecation warning instead sometime this week. The changes to datamodel.rst and tarfile.py should stay, I think. test_format and test_unicode will both verify current* behavior and check for the deprecation warning, and unicodeobject.c

[issue19995] %c, %o, %x, %X accept non-integer values instead of raising an exception

2014-01-09 Thread Ethan Furman
Ethan Furman added the comment: Could somebody explain this? === ethan@media:~/source/python/issue19995_depr$ ./python -W error Python 3.4.0b1 (default:2f81f0e331f6+, Jan 9 2014, 20:30:18) [GCC 4.7.3] on linux Type

[issue19995] %c, %o, %x, %X accept non-integer values instead of raising an exception

2014-01-10 Thread Ethan Furman
Ethan Furman added the comment: For anyone paying really close attention, I've already switched the assertEquals to assertEqual. ;) -- Added file: http://bugs.python.org/file33414/issue19995.stoneleaf.04.patch ___ Python tracker

[issue16508] include the "object" type in the lists of documented types

2014-01-11 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue16508> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2014-01-12 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue1820> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20230] structseq types should expose _fields

2014-01-12 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue20230> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19995] %c, %o, %x, %X accept non-integer values instead of raising an exception

2014-01-14 Thread Ethan Furman
Ethan Furman added the comment: Depracation warning is in place for 3.4. When 3.5 is tagged I'll switch it an error. -- stage: patch review -> commit review ___ Python tracker <http://bugs.python.org

[issue20284] patch to implement %-interpolation for bytes (roughly PEP 461)

2014-01-17 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue20284> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18574] BaseHTTPRequestHandler.handle_expect_100() sends invalid response

2014-01-17 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue18574> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12704] Language Reference: Clarify behaviour of yield when generator is not resumed

2014-01-17 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue12704> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7776] http.client.HTTPConnection tunneling is broken

2014-01-17 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue7776> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17814] Popen.stdin/stdout/stderr documentation should mention object type

2014-01-17 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue17814> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17811] Improve os.readv() and os.writev() documentation and docstring

2014-01-17 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue17811> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman
Ethan Furman added the comment: Here's a patch for the test. -- Added file: http://bugs.python.org/file33706/issue20386.stoneleaf.test.patch.01 ___ Python tracker <http://bugs.python.org/is

[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman
Ethan Furman added the comment: Complete patch with new test, fixed tests, and regression fix. Doc patch still needed. -- stage: test needed -> patch review Added file: http://bugs.python.org/file33707/issue20386.stoneleaf.patch.02 ___ Pyt

[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman
Ethan Furman added the comment: The containers are there to help with discoverability. If you want to know what all the (common) AF values are you can either do [name for name in dir(socket) if name.isupper() and name.startswith('AF_')] or list(socket.Add

[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman
Ethan Furman added the comment: How do we feel about SockType instead? (Just a short round of bike-shedding, promise! ;) -- ___ Python tracker <http://bugs.python.org/issue20

[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-26 Thread Ethan Furman
Ethan Furman added the comment: Okay, staying with SocketKind. This patch also has a very small doc enhancement. -- keywords: +patch Added file: http://bugs.python.org/file33735/issue20386.stoneleaf.03.patch ___ Python tracker <h

[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-27 Thread Ethan Furman
Ethan Furman added the comment: Well, so far I have tried: :class:`IntEnum` :class:`.IntEnum` :class:`~IntEnum` :class:`enum.IntEnum` :class:`.enum.IntEnum` :class:`~enum.IntEnum` :class:`~.enum.IntEnum` and probably some others I have forgotten; nothing is giving me a link to

[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-27 Thread Ethan Furman
Ethan Furman added the comment: IntEnum is not a class in the socket module. How do I make a link into another rst document? -- ___ Python tracker <http://bugs.python.org/issue20

[issue20412] Enum and IntEnum classes are not defined in the documentation

2014-01-27 Thread Ethan Furman
New submission from Ethan Furman: While trying to update the socket documentation it was brought to my attention that Enum and IntEnum are not defined as classes as far as the docs are concerned [1]. [1] http://bugs.python.org/issue20386#msg209473 -- assignee: ethan.furman messages

[issue20457] Use partition and enumerate make getopt easier

2014-01-31 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue20457> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20467] Confusing wording about __init__

2014-01-31 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue20467> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-02-06 Thread Ethan Furman
Ethan Furman added the comment: Thanks for the hints, Georg! -- Added file: http://bugs.python.org/file33945/issue20386.stoneleaf.04.patch ___ Python tracker <http://bugs.python.org/issue20

[issue20534] Enum tests fail with pickle protocol 4

2014-02-06 Thread Ethan Furman
New submission from Ethan Furman: enum34, the Enum backport, specifically uses `protocol=HIGHEST_PROTOCOL`, while the current enum tests just use the default. Running the enum34 test expose an issue with pickle protocol 4

[issue20534] Enum tests fail with pickle protocol 4

2014-02-06 Thread Ethan Furman
Ethan Furman added the comment: Working on fixing tests now. Not sure I can fix pickle (at least not in time for RC1). -- ___ Python tracker <http://bugs.python.org/issue20

[issue20534] Enum tests fail with pickle protocol 4

2014-02-06 Thread Ethan Furman
Ethan Furman added the comment: Thanks, Antoine, that was what I needed. -- assignee: -> ethan.furman keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file33949/issue20534.stoneleaf.01.patch ___ Python t

[issue20534] Enum tests fail with pickle protocol 4

2014-02-06 Thread Ethan Furman
Ethan Furman added the comment: Serhiy, the minimum supported pickle protocol is 2. Now testing all protocols from 2 to HIGHEST_PROTOCOL, inclusive. -- ___ Python tracker <http://bugs.python.org/issue20

[issue20534] Enum tests fail with pickle protocol 4

2014-02-07 Thread Ethan Furman
Ethan Furman added the comment: Because I didn't know how to make it work with 0 and 1. Thank you! I'll get that in today. -- stage: committed/rejected -> patch review status: closed -> open ___ Python tracker <http://bugs.py

[issue20534] Enum tests fail with pickle protocol 4

2014-02-07 Thread Ethan Furman
Ethan Furman added the comment: Okay, I went with __reduce__ since we don't ever use the pickle protocol information. I added a test for class-nested Enums since protocol 4 supports it. I left the test for test_subclasses_without_getnewargs alone as the point of that test is to make

[issue20534] Enum tests fail with pickle protocol 4

2014-02-07 Thread Ethan Furman
Ethan Furman added the comment: I also removed the protocol 2 warning from the docs, and added this note: .. note:: With pickle protocol version 4 it is possible to easily pickle enums nested in other classes. -- ___ Python tracker <h

[issue20543] ** operator does not overflow to inf

2014-02-07 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue20543> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20534] Enum tests fail with pickle protocol 4

2014-02-07 Thread Ethan Furman
Ethan Furman added the comment: The version 2 docs: http://docs.python.org/2/library/pickle.html#object.__reduce_ex__: - The object class implements both __reduce__() and __reduce_ex__(); however, if a subclass overrides

[issue20534] Enum tests fail with pickle protocol 4

2014-02-07 Thread Ethan Furman
Ethan Furman added the comment: Ethan commented: > I left the test for test_subclasses_without_getnewargs alone as the point of > that test is to make sure that _make_class_unpicklable is working properly, > not to see if we can somehow get any of it to pickle. Serhi

[issue20534] Enum tests fail with pickle protocol 4

2014-02-08 Thread Ethan Furman
Ethan Furman added the comment: The only thing I hate more than being wrong is being wrong because Python isn't acting the way I think it should. :/ So, __qualname__ is not set properly when using the function API (although it has nothing to do with manually setting __module__ (I remov

[issue20534] Enum tests fail with pickle protocol 4

2014-02-08 Thread Ethan Furman
Ethan Furman added the comment: Serhiy commented: - > Actually they don't pickle due to wrong __module__. After adding > >NEI.__module__ = NamedInt.__module__ = __name__ > > PicklingError no longer raised for enum class. If you were to look at the `_ma

[issue20534] Enum tests fail with pickle protocol 4

2014-02-08 Thread Ethan Furman
Ethan Furman added the comment: I do not recall if it was or not. The main difference would be in how aliases were handled. For example, if W and Z were the same value on system A, but different on system B, then going from A - B via pickle W and Z would still be the same using the current

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2014-02-13 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue11406> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18652] Add itertools.first_true (return first true item in iterable)

2014-02-15 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue18652> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20653] Pickle enums by name

2014-02-17 Thread Ethan Furman
Ethan Furman added the comment: I agree that pickling by name is the better solution. Serhiy, could you explain how the un-pickling works with protocol 4? -- assignee: -> ethan.furman ___ Python tracker <http://bugs.python.org/issu

[issue20653] Pickle enums by name

2014-02-18 Thread Ethan Furman
Ethan Furman added the comment: And it is now possible to override and pickle by name if your custom subclass so chooses. -- ___ Python tracker <http://bugs.python.org/issue20

[issue20653] Pickle enums by name

2014-02-18 Thread Ethan Furman
Ethan Furman added the comment: Patch allows subclass to override __reduce_ex__, which is useful if a mixed-in type does not have proper pickle support. -- Added file: http://bugs.python.org/file34138/issue20653.stoneleaf.01.patch ___ Python tracker

[issue20653] Pickle enums by name

2014-02-18 Thread Ethan Furman
Ethan Furman added the comment: Proposal to switch to pickle by name rejected, but Enum now allows __reduce_ex__ to be overwridden in subclasses. -- priority: release blocker -> normal ___ Python tracker <http://bugs.python.org/issu

[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-18 Thread Ethan Furman
New submission from Ethan Furman: 587fd4b91120: Better pickle support for Enum subclasses. -- assignee: larry messages: 211552 nosy: ethan.furman, larry priority: release blocker severity: normal stage: commit review status: open title: 3.4 cherry-pick: 587fd4b91120 improve Enum

[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-20 Thread Ethan Furman
Ethan Furman added the comment: When I implemented pickle support I did not have a complete understanding of the pickle protocols nor how to best use them. As a result, I picked __getnewargs__ and only supported protocols 2 and 3 (4 didn't exist yet). Serhiy came along and explained a

[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-20 Thread Ethan Furman
Changes by Ethan Furman : -- Removed message: http://bugs.python.org/msg211739 ___ Python tracker <http://bugs.python.org/issue20679> ___ ___ Python-bugs-list m

[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-20 Thread Ethan Furman
Ethan Furman added the comment: When I implemented pickle support I did not have a complete understanding of the pickle protocols nor how to best use them. As a result, I picked __getnewargs__ and only supported protocols 2 and 3 (4 didn't exist yet). Serhiy came along and explained a

[issue20653] Pickle enums by name

2014-02-20 Thread Ethan Furman
Ethan Furman added the comment: When I implemented pickle support I did not have a complete understanding of the pickle protocols nor how to best use them. As a result, I picked __getnewargs__ and only supported protocols 2 and 3 (4 didn't exist yet). Serhiy came along and explained a

[issue20653] Pickle enums by name

2014-02-20 Thread Ethan Furman
Ethan Furman added the comment: More explanation: __getnewargs__ is not used by pickle protocol 0 and 1; to support those protocols we need __reduce_ex__. Since __reduce_ex__ works for 0, 1, 2, 3, 4, ... there's no reason to have both __reduce_ex__ *and* __getnewa

[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-20 Thread Ethan Furman
Ethan Furman added the comment: Larry, If I make changes to the patch, should I reverse the original and then commit one new one so you only have one to merge in, or do you mind having two to do? -- ___ Python tracker <http://bugs.python.

[issue20653] Pickle enums by name

2014-02-20 Thread Ethan Furman
Ethan Furman added the comment: Thanks for your comments, Eli, I'll work on getting better comments in the code. The qualname comment is partially related to the pickling changes as it's necessary for protocol 4 (I forgot to put that comment in on the previous pickling change that

[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-20 Thread Ethan Furman
Ethan Furman added the comment: Can we do that? If a doc change can make it so we're not locked in to supporting __getnewargs__ I could live with that. Although, to be honest, I'd rather get the change in *and* have a doc warning that pickling specifics are subject to change in 3.

[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-21 Thread Ethan Furman
Ethan Furman added the comment: Discussion started on PyDev. While working on that I realized/remembered that the main reason to get this in now is that without it a user *cannot* change how pickling works -- (s)he can write the methods, but they will be ignored

[issue20653] Pickle enums by name

2014-02-21 Thread Ethan Furman
Ethan Furman added the comment: Many comments, Eli's and Serhey's code changes incorporated. -- Added file: http://bugs.python.org/file34173/issue20653.stoneleaf.02.patch ___ Python tracker <http://bugs.python.o

[issue20653] Pickle enums by name

2014-02-21 Thread Ethan Furman
Ethan Furman added the comment: Antoine, If the mixed-in class defines __reduce_ex__, and the Enum class defines __reduce__, pickle will see that the Enum class has both, and will call the _ex__ method. It is, therefore, the preferred method (at least by pickle, which is what we are

[issue20653] Pickle enums by name

2014-02-21 Thread Ethan Furman
Ethan Furman added the comment: Yeah, I was confused by that when I first read it as well. The 2.7 docs are even worse in that regard (so there has been some progress :). -- ___ Python tracker <http://bugs.python.org/issue20

[issue20653] Pickle enums by name

2014-02-21 Thread Ethan Furman
Ethan Furman added the comment: Antoine commented: -- > The pickle docs don't mention __reduce_ex__ as being preferred, as in "you > should > use this one", on the contrary. Are we reading the same docs? http://docs.python.org/dev/library/pickle.h

[issue20653] Pickle enums by name

2014-02-21 Thread Ethan Furman
Ethan Furman added the comment: On 02/21/2014 11:26 AM, Antoine Pitrou wrote: > > Are we reading the same comments? LOL, apparently not. -- ___ Python tracker <http://bugs.python.org/i

[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-22 Thread Ethan Furman
Ethan Furman added the comment: Thanks, Larry. I'll have one more patch which will be much better comments in the code, and a small doc enhancement. When it's ready should I reopen this issue or create a new one? -- ___ Python trac

[issue20653] Pickle enums by name

2014-02-22 Thread Ethan Furman
Changes by Ethan Furman : Added file: http://bugs.python.org/file34185/issue20653.stoneleaf.03.patch ___ Python tracker <http://bugs.python.org/issue20653> ___ ___ Pytho

[issue20653] Pickle enums by name

2014-02-22 Thread Ethan Furman
Changes by Ethan Furman : Added file: http://bugs.python.org/file34191/issue20653.stoneleaf.04.patch ___ Python tracker <http://bugs.python.org/issue20653> ___ ___ Pytho

[issue20773] Improve docs for DynamicClassAttribute

2014-02-25 Thread Ethan Furman
New submission from Ethan Furman: Per RDM in issue19030, the docs could be better. -- messages: 212214 nosy: ethan.furman, ncoghlan priority: low severity: normal stage: needs patch status: open title: Improve docs for DynamicClassAttribute

[issue20848] 3.4 cherry-pick: b637064cc696 Improve enum subclass behavior

2014-03-03 Thread Ethan Furman
New submission from Ethan Furman: Two minor code changes addressing the "more pythonic" comments. Major doc enhancement addressing the functional API. Not sure about the markup as I can no longer create the docs on my system. -- assignee: larry messages: 212670 nosy: et

[issue20848] 3.4 cherry-pick: b637064cc696 Improve enum subclass behavior

2014-03-03 Thread Ethan Furman
Ethan Furman added the comment: For the past couple weeks everytime I try I get: sphinx-build -b html -d build/doctrees -D latex_paper_size= . build/html make: sphinx-build: Command not found make: *** [build] Error 127 -- ___ Python tracker

[issue20848] 3.4 cherry-pick: b637064cc696 Improve enum subclass behavior

2014-03-03 Thread Ethan Furman
Ethan Furman added the comment: Ah, thanks! Docs are built, fixed, and built again. Larry, the two cherries to pick for this are: b637064cc696: bulk of doc changes 54ab95407288: fixes for ReST markup Thanks. -- ___ Python tracker <h

[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2014-03-06 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue13936> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2014-03-07 Thread Ethan Furman
Ethan Furman added the comment: If no one else has gotten to this in the next six months or so, I will. :) -- ___ Python tracker <http://bugs.python.org/issue13

[issue20895] Add bytes.empty_buffer and deprecate bytes(17) for the same purpose

2014-03-12 Thread Ethan Furman
New submission from Ethan Furman: `bytes` is a list of integers. Passing a single integer to `bytes()`, as in: --> bytes(7) b'\x00\x00\x00\x00\x00\x00\x00' results in a bytes object containing that many zeroes. I propose that this behavior be deprecated for eventual r

[issue9121] Glossary entry for nested scope incorrect

2010-06-29 Thread Ethan Furman
New submission from Ethan Furman : It currently states "Note that nested scopes work only for reference and not for assignment which will always write to the innermost scope." This should be updated to read, e.g. "Note that unless the new nonlocal keyword is used nested scope

[issue29103] Make enum.py pep8 compliant

2016-12-30 Thread Ethan Furman
Ethan Furman added the comment: Thanks Raymond and Jean-Sebastien. -- ___ Python tracker <http://bugs.python.org/issue29103> ___ ___ Python-bugs-list mailin

[issue29167] Race condition in enum.py:_decompose()

2017-01-05 Thread Ethan Furman
Ethan Furman added the comment: Simon, can you post the exact line of code that causes the error? It would be useful for creating a test case and the couple things I have tried to duplicate the error have worked fine. -- ___ Python tracker <h

[issue29167] Race condition in enum.py:_decompose()

2017-01-05 Thread Ethan Furman
Changes by Ethan Furman : -- assignee: -> ethan.furman stage: -> test needed ___ Python tracker <http://bugs.python.org/issue29167> ___ ___ Python-bugs-

[issue29167] Race condition in enum.py:_decompose()

2017-01-07 Thread Ethan Furman
Ethan Furman added the comment: Thanks. I'll go through and audit all my dictionary iterations. -- nosy: +barry, eli.bendersky ___ Python tracker <http://bugs.python.org/is

[issue29237] Create enum for pstats sorting options

2017-01-10 Thread Ethan Furman
Ethan Furman added the comment: To keep backwards compatibility and lesson the burden on new code, simply make the value of the duplicate names be the same: cumulative = 'cumulative' cumtime = 'cumulative' This way the standard name is 'cumulative

[issue29235] Allow profile/cProfile to be used as context managers

2017-01-10 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman stage: -> needs patch ___ Python tracker <http://bugs.python.org/issue29235> ___ ___ Python-bugs-list mai

[issue29238] Add more kwargs to cProfile's print_stats

2017-01-10 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue29238> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28231] zipfile does not support pathlib

2017-01-11 Thread Ethan Furman
Ethan Furman added the comment: Any path/file attributes, etc, inside a ZipFile should be str. ZipFile should also function properly if path/file requests are given as os.PathLike objects. -- ___ Python tracker <http://bugs.python.org/issue28

[issue29328] struct module should support variable-length strings

2017-01-19 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue29328> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29328] struct module should support variable-length strings

2017-01-19 Thread Ethan Furman
Ethan Furman added the comment: >From Yury Selivanov: --- This is a neat idea, but this will only work for parsing framed binary protocols. For example, if you protocol prefixes all packets with a length field, you can write an efficient read buffer and use your proposal

[issue29167] Race condition in enum.py:_decompose()

2017-01-23 Thread Ethan Furman
Ethan Furman added the comment: Fixed the race condition for both the RuntimeError and for getting duplicate composite members. -- keywords: +patch stage: test needed -> patch review Added file: http://bugs.python.org/file46394/issue29167.stoneleaf.01.pa

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
New submission from Ethan Furman: >From issue29338, msg286139: -- It is easy to fix the [pydoc] test by adding missed lines. But I'm not sure that output the (correct) signature of enum classes makes the help better. Color(value, names=None, *, module=None,

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
Ethan Furman added the comment: That that is very unhelpful help text. :( Better would be: Color(value) So how do we allow Python code to determine the help text? -- ___ Python tracker <http://bugs.python.org/issue29

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
Ethan Furman added the comment: There are actually two signatures: EnumCls(value) --> return member with value `value` EnumCls(name, members, module, qualname, type, start) --> create new Enum An example of the first: class A(Enum): x = 1 A(1) --> an example of the second:

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
Ethan Furman added the comment: Probably not because an enum class' __call__ comes from the type EnumMeta -- so having two different __call__ methods would mean two different metaclasses, and I'm pretty sure I don't want to go there. ;) There is a __doc__ defined for the

[issue29446] Improve tkinter 'import *' situation

2017-02-04 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue29446> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29475] option to not follow symlinks when globbing

2017-02-07 Thread Ethan Furman
Ethan Furman added the comment: Before talking about the patch, have you signed the Contributer License Agreement yet? The issue tracker isn't showing that you have. Check out https://www.python.org/psf/contrib/contrib-form/ to do so. --- The `symlinks` flag: can you give some

[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2017-02-15 Thread Ethan Furman
New submission from Ethan Furman: Consider: class AllEnum(Enum): @classattr def ALL(cls): members = list(cls) all_value = None if members: all_value = members[0] for member in members[1:]: all_value |= member

[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2017-02-15 Thread Ethan Furman
Ethan Furman added the comment: To get the above code snippet to fail properly: - remove the @classattr line - prepend from enum import Enum, Flag, IntFlag, auto -- ___ Python tracker <http://bugs.python.org/issue29

[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2017-02-16 Thread Ethan Furman
Ethan Furman added the comment: While only IntColor fails with an error, Color also fails as it is not a Flag type Enum: >>> list(Color) [, , ] It should have values of 1, 2, 4. -- ___ Python tracker <http://bugs.python.or

[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2017-02-16 Thread Ethan Furman
Ethan Furman added the comment: Possibilities: - only allow one base Enum class (fails with All and IntFlag) - only allow base Enum classes that are compatible (so not an Enum and a Flag) (would require multiple base classes for the same behavior: DocEnum, DocFlag, etc.) - only allow

[issue29594] implementation of __or__ in enum.auto

2017-02-22 Thread Ethan Furman
Ethan Furman added the comment: @Julian: Giving flag combinations their own name can be useful. For example, instead of seeing Color.GREEN|RED one can see Color.YELLOW . @Marc: I'm not convinced this is a needed change as it doesn't seem to be a common method, nor one that cannot

[issue29594] implementation of __or__ in enum.auto

2017-02-22 Thread Ethan Furman
Ethan Furman added the comment: I also think using leading underscores is a better way to signal that a particular value is "weird". -- ___ Python tracker <http://bugs.python.o

[issue29666] Issue in enum documentation

2017-02-27 Thread Ethan Furman
Ethan Furman added the comment: `Flag` and `IntFlag` are indeed the correct (and missing) names. -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue29

[issue29594] implementation of __or__ in enum.auto

2017-03-01 Thread Ethan Furman
Ethan Furman added the comment: aenum 2.0 [1] has been released. Because it also covers Python 2.7 I had to enhance its auto() to cover |, &, ^, and ~ so that Enum classes could be properly created. At this moment your choices are to use odd naming or aenum (with its enhanced auto).

[issue29594] implementation of __or__ in enum.auto

2017-03-01 Thread Ethan Furman
Ethan Furman added the comment: Serhiy, agreed. Closing. Marc, thanks, I see I missed supporting non-auto() combinations. Feel free to open an issue for that at: https://bitbucket.org/stoneleaf/aenum Either way I'll get that fixed. -- resolution: -> rejected stage: -&g

[issue27161] Confusing exception in Path().with_name

2016-05-30 Thread Ethan Furman
Ethan Furman added the comment: I think the request is to raise a single PathlibError instead of the broad range of possible errors. Something like: try: blah blah except TypeError as e: raise PathlibError(str(e)) Since pathlib is a high level library this seems appropriate

[issue22570] Better stdlib support for Path objects using .path attribute

2016-06-02 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman title: Better stdlib support for Path objects -> Better stdlib support for Path objects using .path attribute ___ Python tracker <http://bugs.python.org/issu

[issue26027] Support Path objects in the posix module

2016-06-02 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue26027> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27182] PEP 519 support in the stdlib

2016-06-02 Thread Ethan Furman
New submission from Ethan Furman: Meta issue to track adding PEP 519 support in the various stdlib modules. -- messages: 266891 nosy: brett.cannon, ethan.furman, serhiy.storchaka priority: normal severity: normal status: open title: PEP 519 support in the stdlib

[issue27182] PEP 519 support in the stdlib

2016-06-02 Thread Ethan Furman
Ethan Furman added the comment: posix module: issue26027 -- ___ Python tracker <http://bugs.python.org/issue27182> ___ ___ Python-bugs-list mailing list Unsub

<    7   8   9   10   11   12   13   14   15   16   >