[issue2628] ftplib Persistent data connection

2021-11-01 Thread Ethan Furman


Ethan Furman  added the comment:

Ah.  Well, in that case closing seems like the best idea.

Thank you, Jonathan, for getting the CLA signed and providing perspective.

Thank you, Mike, for moving this issue forward.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue2628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10483] http.server - what is executable on Windows

2021-11-01 Thread Ethan Furman


Ethan Furman  added the comment:

Glen, which version of Python is your fork using?

--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue10483>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2628] ftplib Persistent data connection

2021-11-01 Thread Ethan Furman


Ethan Furman  added the comment:

I would like to have the issue fixed instead of just closed.

Jonathan, you say there is no practical method to verify that the block 
transmission mode exists -- so it's only useful if the user knows that it 
exists?  If the user tries it and the server does not support it, is a useful 
exception raised?  If the answer is yes (to the useful exception) I'm would 
like to see it added.

--
versions: +Python 3.11 -Python 3.2

___
Python tracker 
<https://bugs.python.org/issue2628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2628] ftplib Persistent data connection

2021-10-30 Thread Ethan Furman


Ethan Furman  added the comment:

If you're familiar with git and GitHub, can you create a PR?  Otherwise, an 
updated patch here and we'll work on getting it merged.

--

___
Python tracker 
<https://bugs.python.org/issue2628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45676] Enum: improve generics support

2021-10-29 Thread Ethan Furman


Change by Ethan Furman :


--
assignee: ethan.furman
nosy: ethan.furman
priority: normal
severity: normal
status: open
title: Enum: improve generics support
type: enhancement
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue45676>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45535] Enum's dir() does not contain inherited members

2021-10-29 Thread Ethan Furman


Ethan Furman  added the comment:

Enums have had a custom dir() from the beginning, partly because they are not 
standard objects and do not follow standard rules.

The question posed by this issue is whether Enums with mixed-in data types 
should show the inherited methods, and if yes, should it also show inherited 
`__dunders__`.

I'm inclined to say yes for the normal inherited methods, I'm not sure about 
inherited `__dunders__`.

--

___
Python tracker 
<https://bugs.python.org/issue45535>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45649] Add tarinfo.Path

2021-10-28 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue45649>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2628] ftplib Persistent data connection

2021-10-25 Thread Ethan Furman


Ethan Furman  added the comment:

We don't have a CLA from jbell.  I've sent an email asking him to do so... 
we'll see what happens.

--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue2628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45535] Enum's dir() does not contain inherited members

2021-10-21 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman
versions:  -Python 3.9

___
Python tracker 
<https://bugs.python.org/issue45535>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45535] Enum's dir() does not contain inherited members

2021-10-21 Thread Ethan Furman


Ethan Furman  added the comment:

Looks interesting, thank you for the patch.

--

___
Python tracker 
<https://bugs.python.org/issue45535>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44174] Unclear meaning of _Private__names in enum docs.

2021-10-21 Thread Ethan Furman


Change by Ethan Furman :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue44174>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44174] Unclear meaning of _Private__names in enum docs.

2021-10-21 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset e628700dbf2c3376502cbb5a9bff2d58d1102e16 by Ethan Furman in 
branch '3.9':
[3.9] bpo-44174: [Enum] add name-mangling reference (GH-29128)
https://github.com/python/cpython/commit/e628700dbf2c3376502cbb5a9bff2d58d1102e16


--

___
Python tracker 
<https://bugs.python.org/issue44174>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44174] Unclear meaning of _Private__names in enum docs.

2021-10-21 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +27404
pull_request: https://github.com/python/cpython/pull/29128

___
Python tracker 
<https://bugs.python.org/issue44174>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44174] Unclear meaning of _Private__names in enum docs.

2021-10-21 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 828722aca4ccba893f6b2e8c1d41fd74fd6e208d by Ethan Furman in 
branch '3.10':
[3.10] bpo-44174: [Enum] add reference to name mangling (GH-29117)
https://github.com/python/cpython/commit/828722aca4ccba893f6b2e8c1d41fd74fd6e208d


--

___
Python tracker 
<https://bugs.python.org/issue44174>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44174] Unclear meaning of _Private__names in enum docs.

2021-10-20 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +27393
pull_request: https://github.com/python/cpython/pull/29117

___
Python tracker 
<https://bugs.python.org/issue44174>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44174] Unclear meaning of _Private__names in enum docs.

2021-10-20 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 7c4d96103c4e16161e9aed9a584c9857d0674099 by Ethan Furman in 
branch 'main':
bpo-44174: [Enum] add reference to name mangling (GH-29116)
https://github.com/python/cpython/commit/7c4d96103c4e16161e9aed9a584c9857d0674099


--

___
Python tracker 
<https://bugs.python.org/issue44174>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44174] Unclear meaning of _Private__names in enum docs.

2021-10-20 Thread Ethan Furman


Change by Ethan Furman :


--
keywords: +patch
pull_requests: +27392
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29116

___
Python tracker 
<https://bugs.python.org/issue44174>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44559] Enum: revert to 3.9

2021-10-20 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 2a9ab75af32b1ee9f210ae2a0718990687d0f79d by Ethan Furman in 
branch '3.10':
bpo-44559: [Enum] restore fixes lost in 3.9 reversion (GH-29114)
https://github.com/python/cpython/commit/2a9ab75af32b1ee9f210ae2a0718990687d0f79d


--

___
Python tracker 
<https://bugs.python.org/issue44559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Ethan Furman


Ethan Furman  added the comment:

I'm confused -- your initial report talks about pickling fields, but your tests 
are pickling the entire class... what am I missing?

--

___
Python tracker 
<https://bugs.python.org/issue45546>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44559] Enum: revert to 3.9

2021-10-20 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +27385
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29114

___
Python tracker 
<https://bugs.python.org/issue44559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42517] Enum: do not convert private names into members

2021-10-20 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 9733c9651afad84ab2f010e9e68b7c03976ea9f3 by Ethan Furman in 
branch '3.9':
[3.9] bpo-42517: [ENUM] update docs for changes coming in 3.11 (GH-29113)
https://github.com/python/cpython/commit/9733c9651afad84ab2f010e9e68b7c03976ea9f3


--

___
Python tracker 
<https://bugs.python.org/issue42517>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42517] Enum: do not convert private names into members

2021-10-20 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +27380
pull_request: https://github.com/python/cpython/pull/29113

___
Python tracker 
<https://bugs.python.org/issue42517>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44174] Unclear meaning of _Private__names in enum docs.

2021-10-20 Thread Ethan Furman


Ethan Furman  added the comment:

It has been moved to the tutorial (links are at the top of the Enum page).

--

___
Python tracker 
<https://bugs.python.org/issue44174>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45493] str() and repr() of enum different in Python 3.11 from Python <= 3.10

2021-10-18 Thread Ethan Furman


Ethan Furman  added the comment:

Enum was reverted at the last minute for 3.10.  I would like to keep the 
changes in 3.11 so they get more exposure.

I have asked the SC a few times for thoughts about PEP 663, including whether 
an information PEP needs formal approval, but still haven't heard back.

At any rate, I do not have the band-width to undo and then redo all the changes 
in the 3.11 Enum.

--

___
Python tracker 
<https://bugs.python.org/issue45493>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45517] TarFile.add skips files when tarfile name matches a directory

2021-10-18 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue45517>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45417] Enum creation non-linear in the number of values

2021-10-15 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman
stage: patch review -> backport needed
versions:  -Python 3.9

___
Python tracker 
<https://bugs.python.org/issue45417>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45473] Enum: add "name" and "value" keywords to call syntax

2021-10-15 Thread Ethan Furman


Ethan Furman  added the comment:

> Are there any other names that you would contemplate besides `from_name` and
> `from_value`?

No.

> My reading of your response indicates that you are fundamentally opposed to
> the addition of class methods, since they would limit the space of possible
> instance methods/members.  Is that a fair reading?

Yes.

Instance methods/attributes are not an issue, though, as the instance namespace 
and the class namespace are distinct -- which is why we can have a `value` 
member even though each member has a `value` attribute.

The issue is that class methods/attributes and members (which look like 
attributes) all live in the class namespace, so we cannot have both a 
`from_value` member and a `from_value` class method in the class namespace.

> Do you agree with the fundamental issue that is identified: that the
> parenthesis/square bracket construction is difficult to read and makes
> implementation mistakes more likely?

Only partially.  Being able to easily tell the difference between round and 
square brackets is an important skill to have.  With enums, square brackets are 
akin to dictionary lookup, which uses (string) keys, and the keys of an enum 
are the member names; that leaves round brackets (parenthesis), which is call 
syntax, for value lookup.

Additionally, if the wrong syntax is used then an exception will be raised at 
that location, making it an easy  fix.

> One alternative to the class methods I might propose is to use a keyword
> argument in the __init__ function.
>
>SomeEnum(name="foo")
>SomeEnum(value="bar")
>
> This would also solve the stated problem, but I suspect that messing with the
> init function introduces more limitations to the class than the classmethod
> solution.

This idea has come up before.  I'll look into it.

--
title: Enum add "from_name" and "from_value" class methods -> Enum: add "name" 
and "value" keywords to call syntax

___
Python tracker 
<https://bugs.python.org/issue45473>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45473] Enum add "from_name" and "from_value" class methods

2021-10-14 Thread Ethan Furman


Ethan Furman  added the comment:

The problem with adding methods is that those names are then unavailable for 
member names -- at least not without possible confusion.

Also, unlike the `name` and `value` instance attributes which do not hide class 
attributes (aka members) of the same name, `from_name` is a class method so we 
couldn't have both a `from_name()` class method and a `from_name` class member 
at the same time.

If those are issues you know wouldn't a problem for you, you can create your 
own base Enum class with those methods defined, and then inherit from them:

class EasyEnum(Enum):
@classmethod
def from_name(cls, name):
return cls[name]
# etc

 class MyEnum(EasyEnum):
  RED = 1
  # etc.

On the other hand, if you want to use this with any enum, then you'll need to 
make your own helper functions:

def from_name(enum, name):
return enum[name]

enum_member = from_name(MyEnum, 'RED')

--

___
Python tracker 
<https://bugs.python.org/issue45473>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45417] Enum creation non-linear in the number of values

2021-10-14 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset b2af211e229df941d9b404f69547a264115156b5 by Carl Friedrich 
Bolz-Tereick in branch 'main':
bpo-45417: [Enum] fix quadratic behavior during creation (GH-28907)
https://github.com/python/cpython/commit/b2af211e229df941d9b404f69547a264115156b5


--

___
Python tracker 
<https://bugs.python.org/issue45417>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45473] Enum add "from_name" and "from_value" class methods

2021-10-14 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman
nosy: +ethan.furman
versions: +Python 3.11

___
Python tracker 
<https://bugs.python.org/issue45473>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44559] Enum: revert to 3.9

2021-10-13 Thread Ethan Furman


Ethan Furman  added the comment:

Going back through the various bug fixes that got cut from 3.10 to re-add to 
3.10.1.

--

___
Python tracker 
<https://bugs.python.org/issue44559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42248] Raised exception in Enum keeping user objects alive unnecessarily

2021-10-13 Thread Ethan Furman


Ethan Furman  added the comment:

Going back through the various bug fixes that got cut from 3.10 to re-add to 
3.10.1.

--

___
Python tracker 
<https://bugs.python.org/issue42248>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38659] enum classes cause slow startup time

2021-10-12 Thread Ethan Furman


Ethan Furman  added the comment:

The reason for that quadratic behavior is that for each new member (aka 
attribute), all the previous members must be checked to see if the new member 
is a duplicate.

In practice I wouldn't expect this to be a problem as most enums should be 
fairly small -- are there any real-world examples where there are more than, 
say, a hundred?

--

___
Python tracker 
<https://bugs.python.org/issue38659>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45331] Can create enum of ranges, cannot create range enum. Range should be subclassable... or EnumMeta.__new__ should be smarter.

2021-09-30 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman
nosy: +ethan.furman
versions: +Python 3.11 -Python 3.9

___
Python tracker 
<https://bugs.python.org/issue45331>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45185] test.test_ssl.TestEnumerations is not run

2021-09-13 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue45185>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue45155>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45133] Open functions in dbm submodule should support path-like objects

2021-09-07 Thread Ethan Furman


Change by Ethan Furman :


--
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue45133>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40563] Support pathlike objects on dbm/shelve

2021-09-07 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue40563>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41026] mailbox does not support new Path object

2021-09-07 Thread Ethan Furman


Ethan Furman  added the comment:

The problem with using `str()` on a path argument is that the argument may not 
be a str, nor a pathlib object, but `str()` will still create a string out of 
it, leading to difficult bugs.

The documentation for pathlib also predates the addition of `os.fspath()`.

--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue41026>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32562] Support fspath protocol in AF_UNIX sockaddr resolution

2021-09-07 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue32562>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40506] add support for os.Pathlike filenames in zipfile.ZipFile.writestr

2021-09-07 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue40506>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44993] enum.auto() starts with one instead of zero

2021-08-25 Thread Ethan Furman


Ethan Furman  added the comment:

David, I added a PR for the Enum handling/creation in the ics library.  Syncing 
values with external libraries is definitely *not* what `auto` is intended for.

As for why enum members evaluate as True:  most objects in Python evaluate to 
True, unless they have a reason not to (such as an empty container or the 
number 0).  One of the main ideas behind the creation of Enum is that the exact 
values didn't usually matter,  but when they did they would be specified.  
`auto()` was added later to make the "doesn't usually matter" case easier.

---

Vedran, or `cEnum`?  ;-)

One concern is should cEnum be Python's `int`, or a c_type int?  That should be 
in a new issue, though.

Okay, it's Issue45004.

--
stage:  -> resolved

___
Python tracker 
<https://bugs.python.org/issue44993>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45004] add Enum to ctypes

2021-08-25 Thread Ethan Furman


New submission from Ethan Furman :

In issue44993 it was suggested to add a cEnum whose main purpose would be to 
start counting at 0 instead of 1.

Issues to consider:

- should such an enum subclass `int`, or a C type?

- should there be an enum for each C type?

- will mixing Enum and c_types even work?

--
messages: 400289
nosy: amaury.forgeotdarc, belopolsky, ethan.furman, meador.inge
priority: normal
severity: normal
status: open
title: add Enum to ctypes
type: enhancement
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue45004>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44993] enum.auto() starts with one instead of zero

2021-08-25 Thread Ethan Furman


Ethan Furman  added the comment:

Putting an enum in the ctypes module is a decent idea.

--

___
Python tracker 
<https://bugs.python.org/issue44993>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-25 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 24da544014f78e6f1440d5ce5c2d14794a020340 by Pablo Galindo Salgado 
in branch 'main':
bpo-44929: [Enum] Fix global repr (GH-27789)
https://github.com/python/cpython/commit/24da544014f78e6f1440d5ce5c2d14794a020340


--

___
Python tracker 
<https://bugs.python.org/issue44929>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44993] enum.auto() starts with one instead of zero

2021-08-24 Thread Ethan Furman


Ethan Furman  added the comment:

David, what is the actual use-case that tripped you up?  There are a few ways 
to create Enums from other systems (json files, cpp files, etc.).

--

___
Python tracker 
<https://bugs.python.org/issue44993>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44993] enum.auto() starts with one instead of zero

2021-08-24 Thread Ethan Furman


Ethan Furman  added the comment:

My apologies for my apologies -- for some reason I thought this was first 
posted in August of 2020.

--

___
Python tracker 
<https://bugs.python.org/issue44993>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44993] enum.auto() starts with one instead of zero

2021-08-24 Thread Ethan Furman


Ethan Furman  added the comment:

Firstly (or Zeroithly ;) my apologies for not noticing this earlier.


In the functional API section:
--
The reason for defaulting to 1 as the starting number and not 0 is that 0 is 
False in a boolean sense, but enum members all evaluate to True.

---

To the best of my knowledge, Python Enums are different from other languages' 
enums in several respects; apparently this is one of them.  Having the default 
first value be 1 has been there since the beginning, and isn't going to change 
now.

Rather than allowing numbers to be assigned using the function that says the 
assigned number doesn't matter, I would rather add `start=x` in the header, the 
way I have it in `aenum`:

from aenum import Enum, auto

class ZeroEnum(Enum, start=0):
nothing = auto()
something = auto()

list(ZeroEnum)
# [, ]

class ZeroBaseEnum(Enum, start=0):
pass

class ZeroEnum2(ZeroBaseEnum):
nothing = auto()
something = auto()

list(ZeroEnum2)
# [, ]


Whether the `0` goes in the header, or in auto (which it isn't), people will 
still need to read the docs to find out about it (unless somebody asks an SO 
question, of course).

--
assignee:  -> ethan.furman
resolution:  -> not a bug

___
Python tracker 
<https://bugs.python.org/issue44993>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-18 Thread Ethan Furman


Ethan Furman  added the comment:

`_name_` is only None if the entire enum value is outside any named member and 
`_boundary_` is `KEEP` -- so

class Example(Flag, boundary=KEEP):
first = auto()
second = auto()
third = auto()

>>> Example(0)
module.Example(0)

>>> Example(8)
module.Example(8)

No need to backport.

--
versions:  -Python 3.10

___
Python tracker 
<https://bugs.python.org/issue44929>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44899] tarfile: add support for creating an archive of potentially changing files

2021-08-17 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman
versions: +Python 3.11 -Python 3.7

___
Python tracker 
<https://bugs.python.org/issue44899>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44559] Enum: revert to 3.9

2021-07-27 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 2f54fbafa6481fb10528cb1d3d6b517ca2a4647f by Steffen Zeile in 
branch 'main':
bpo-44559: [Enum] correct `versionadded` to 3.11 for new features (GH-27388)
https://github.com/python/cpython/commit/2f54fbafa6481fb10528cb1d3d6b517ca2a4647f


--

___
Python tracker 
<https://bugs.python.org/issue44559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44559] Enum: revert to 3.9

2021-07-12 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +25647
pull_request: https://github.com/python/cpython/pull/27099

___
Python tracker 
<https://bugs.python.org/issue44559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC

2021-07-08 Thread Ethan Furman


Ethan Furman  added the comment:

Andrei, which code did you try?  I'm still seeing the failure (i.e. the class 
being created) in 3.8 and forward.

--
versions: +Python 3.11, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue35815>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44559] Enum: revert to 3.9

2021-07-03 Thread Ethan Furman


Change by Ethan Furman :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue44559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44559] Enum: revert to 3.9

2021-07-03 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 9bf7c2d638a582af2444bc864feba13ab8957b68 by Ethan Furman in 
branch '3.10':
[3.10] bpo-44559: [Enum] revert enum module to 3.9 (GH-27010)
https://github.com/python/cpython/commit/9bf7c2d638a582af2444bc864feba13ab8957b68


--

___
Python tracker 
<https://bugs.python.org/issue44559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44559] Enum: revert to 3.9

2021-07-03 Thread Ethan Furman


Change by Ethan Furman :


--
keywords: +patch
pull_requests: +25570
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27010

___
Python tracker 
<https://bugs.python.org/issue44559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44559] Enum: revert to 3.9

2021-07-03 Thread Ethan Furman

New submission from Ethan Furman :

>From the SC (was Re: Enum -- last call for comments on 3.10 changes)

> The Steering Council discussed this topic at our meeting yesterday.  We have 
> some
> discomfort about the changes to Enum’s str and repr in Python 3.10, both in 
> the
> specific changes and in the way the changes were decided on.  No knock on 
> Ethan or
> others who participated in those decisions, it’s just that to us, the changes
> cumulatively feel like they need a more formal, centralized discussion to 
> understand
> all the issues in detail.
> 
> While we’re stopping short of requiring it, the Steering Council strongly 
> suggests that
> for Python 3.10, the changes in Enum’s str and repr be reverted back to the 
> Python 3.9
> behavior, and that a PEP be written for Python 3.11.

The changes were primarily spurred both by the changes to re.RegexFlag and by 
unfortunate choices made in enum.Flag regarding aliases and iteration that were 
corrected.

Unfortunately, it proved too difficult to revert the Flag repr() while keeping 
the corrections, so the entire enum module is being reverted to its 3.9 version.

All the bug-fixes, performance improvements, and other enhancements will have 
to wait for 3.11.

--
assignee: ethan.furman
components: Library (Lib)
messages: 396935
nosy: barry, brett.cannon, ethan.furman, pablogsal, twouters, willingc
priority: release blocker
severity: normal
status: open
title: Enum: revert to 3.9
versions: Python 3.10

___
Python tracker 
<https://bugs.python.org/issue44559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-19 Thread Ethan Furman


Change by Ethan Furman :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43329] Multiprocessing Manager Client Not Reconnecting

2021-06-18 Thread Ethan Furman


Ethan Furman  added the comment:

Here is the test, reduced and in a single script:

--- 8< 
import multiprocessing.managers, os, sys, time

if __name__ == '__main__':
address = ("127.0.0.1", 54321)

class TestManager(multiprocessing.managers.BaseManager):
pass

if sys.argv[1] == 'server':

class TestClass(object):
def test_method(self):
print("In test_method")
return "TEST"

TestManager.register("Test", TestClass)
manager = TestManager(address = address, authkey = 
"1234".encode("utf-8"))
print('waiting...')
manager.get_server().serve_forever()

else:

TestManager.register("Test")

manager = TestManager(address = address, authkey = 
"1234".encode("utf-8"))
manager.connect()
test_class = manager.Test()

print(test_class.test_method())

print("Kill and restart the server and press return")
sys.stdin.readline()

try:
print(test_class.test_method())
except EOFError:
print('EOF received\n')

# reestablish connection
manager.connect()
test_class = manager.Test()

# trigger error
print(test_class.test_method())
--- 8< 

Running it in two terminals gives (only showing client side):

---
$ ./python ~/test_mp client
TEST
Kill and restart the server and press return
# hit 
EOF received

Traceback (most recent call last):
  File "/home/ethan/test_mp", line 45, in 
print(test_class.test_method())
  File "", line 2, in test_method
  File "/source/virtualenv/lib/python3.9/multiprocessing/managers.py", line 
808, in _callmethod
conn.send((self._id, methodname, args, kwds))
  File "/source/virtualenv/lib/python3.9/multiprocessing/connection.py", line 
211, in send
self._send_bytes(_ForkingPickler.dumps(obj))
  File "/source/virtualenv/lib/python3.9/multiprocessing/connection.py", line 
416, in _send_bytes
self._send(header + buf)
  File "/source/virtualenv/lib/python3.9/multiprocessing/connection.py", line 
373, in _send
n = write(self._handle, buf)
BrokenPipeError: [Errno 32] Broken pipe
---

The problem appears to be that the call to `manager.connect()` after the EOF is 
not getting a new connection, but is reusing the old one (?).  This is as far 
as I can take this; hopefully somebody with more multiprocessing/socket skills 
can take it from here.

--
nosy: +davin, pitrou, serhiy.storchaka
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8

___
Python tracker 
<https://bugs.python.org/issue43329>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29158] Possible glitch in the interaction of a thread and a multiprocessing manager

2021-06-18 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue29158>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44457] Finish format() change started in issue43945

2021-06-18 Thread Ethan Furman


New submission from Ethan Furman :

Finish the work started in issue43945 -- in 3.12 `format()` now uses the enum 
member itself instead of its `value`; e.g.:

>>> class Color(int, Enum):
... RED = 1

>>> f"{Color.RED}"
'RED'
>>> f"{Color.RED:d}"
'1'

--
assignee: ethan.furman
messages: 396098
nosy: ethan.furman
priority: normal
severity: normal
status: open
title: Finish format() change started in issue43945
type: behavior

___
Python tracker 
<https://bugs.python.org/issue44457>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44457] Finish format() change started in issue43945

2021-06-18 Thread Ethan Furman


Change by Ethan Furman :


--
status: open -> pending

___
Python tracker 
<https://bugs.python.org/issue44457>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43945] [Enum] standardize format() behavior

2021-06-18 Thread Ethan Furman


Change by Ethan Furman :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue43945>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43945] [Enum] standardize format() behavior

2021-06-18 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 1b4addf3cbd0ef424939681ee67c802328d567ba by Ethan Furman in 
branch '3.10':
[3.10] bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752) 
https://github.com/python/cpython/commit/1b4addf3cbd0ef424939681ee67c802328d567ba


--

___
Python tracker 
<https://bugs.python.org/issue43945>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43329] Multiprocessing Manager Client Not Reconnecting

2021-06-18 Thread Ethan Furman


Ethan Furman  added the comment:

Michael Boon wrote:
---
> The [above] issue is pretty serious and it is preventing me from using a
> system I wrote on a larger scale.

That statement suggests you were able to get this working on a small scale -- 
is that correct?  What does the working small-scale code look like?

--
nosy: +ethan.furman

___
Python tracker 
<https://bugs.python.org/issue43329>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43945] [Enum] standardize format() behavior

2021-06-18 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +25375
pull_request: https://github.com/python/cpython/pull/26791

___
Python tracker 
<https://bugs.python.org/issue43945>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43945] [Enum] standardize format() behavior

2021-06-18 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset f60b07ab6c943fce084772c3c7731ab3bbd213ff by Ethan Furman in 
branch 'main':
bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752)
https://github.com/python/cpython/commit/f60b07ab6c943fce084772c3c7731ab3bbd213ff


--

___
Python tracker 
<https://bugs.python.org/issue43945>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43945] [Enum] standardize format() behavior

2021-06-15 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +25337
pull_request: https://github.com/python/cpython/pull/26752

___
Python tracker 
<https://bugs.python.org/issue43945>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43945] [Enum] standardize format() behavior

2021-06-15 Thread Ethan Furman


Ethan Furman  added the comment:

Thinking about this some more I am partially reversing course.  The idea behind 
`IntEnum` and `IntFlag` is to be, as close as possible, drop-in replacements 
for existing integer-based constants.  If the format() of those two change then 
they become much less attractive.

So it won't.  Instead, any user-mixed enumerations will get the new behavior:

class Grades(int, Enum):
A = 5
F = 0

will emit a DeprecationWarning now, and in 3.12 `format(Grades.A)` will product 
'A' instead of '5'.

--

___
Python tracker 
<https://bugs.python.org/issue43945>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-15 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 41c2a4a727d3d559632598759433e0ec1bf594f5 by Ethan Furman in 
branch '3.10':
[3.10] bpo-44342: [Enum] improve test, add andrei kulakov to ACKS (GH-26726)
https://github.com/python/cpython/commit/41c2a4a727d3d559632598759433e0ec1bf594f5


--

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-15 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 741b8ae1cfc507902eb57e20f003487af13e40c0 by Ethan Furman in 
branch 'main':
bpo-44342: [Enum] sync current docs to 3.10 (GH-26750)
https://github.com/python/cpython/commit/741b8ae1cfc507902eb57e20f003487af13e40c0


--

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-15 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +25335
pull_request: https://github.com/python/cpython/pull/26750

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-15 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +25332
pull_request: https://github.com/python/cpython/pull/26747

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-15 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 0f99324f61d5a2edd8729be5eed6f172c892af24 by Miss Islington (bot) 
in branch '3.10':
bpo-44342: [Enum] fix data type search (GH-26667)
https://github.com/python/cpython/commit/0f99324f61d5a2edd8729be5eed6f172c892af24


--

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-14 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +25316
pull_request: https://github.com/python/cpython/pull/26726

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44242] enum.IntFlag regression: missing values cause TypeError

2021-06-14 Thread Ethan Furman


Ethan Furman  added the comment:

Yup, just had to get back from the weekend.  :-)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue44242>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44242] enum.IntFlag regression: missing values cause TypeError

2021-06-11 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 0a186b1ec1fd094d825f08a4eb39fa83ef57067a by Miss Islington (bot) 
in branch '3.10':
bpo-44242: [Enum] improve error messages (GH-26669)
https://github.com/python/cpython/commit/0a186b1ec1fd094d825f08a4eb39fa83ef57067a


--

___
Python tracker 
<https://bugs.python.org/issue44242>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44242] enum.IntFlag regression: missing values cause TypeError

2021-06-11 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset c956734d7af83ad31f847d31d0d26df087add9a4 by Ethan Furman in 
branch 'main':
bpo-44242: [Enum] improve error messages (GH-26669)
https://github.com/python/cpython/commit/c956734d7af83ad31f847d31d0d26df087add9a4


--

___
Python tracker 
<https://bugs.python.org/issue44242>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44242] enum.IntFlag regression: missing values cause TypeError

2021-06-11 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +25256
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26669

___
Python tracker 
<https://bugs.python.org/issue44242>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44242] enum.IntFlag regression: missing values cause TypeError

2021-06-11 Thread Ethan Furman


Ethan Furman  added the comment:

Also changing error reporting to be less susceptible to DOS attacks.

--
resolution: fixed -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 
<https://bugs.python.org/issue44242>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-11 Thread Ethan Furman


Ethan Furman  added the comment:

Also fixing the search for the data type so that in

  A -> B -> C

the data type is C and not B.

--

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-11 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 3a7cccfd6cd3693e1a2ab65ee05d7f45f8501dfa by Ethan Furman in 
branch 'main':
bpo-44342: [Enum] fix data type search (GH-26667)
https://github.com/python/cpython/commit/3a7cccfd6cd3693e1a2ab65ee05d7f45f8501dfa


--

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44356] Multiple enum mixins not allowed even when they have the same datatype

2021-06-11 Thread Ethan Furman


Ethan Furman  added the comment:

Glad you like it!

Please don't change the title back.  :-)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: Abstract enum mixins not allowed -> Multiple enum mixins not allowed 
even when they have the same datatype
versions:  -Python 3.8

___
Python tracker 
<https://bugs.python.org/issue44356>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-11 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +25254
pull_request: https://github.com/python/cpython/pull/26667

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-11 Thread Ethan Furman


Ethan Furman  added the comment:

Changing `__reduce_ex__` is too big a change for 3.9, so making the search for 
pickle support more robust there.

--

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-11 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +25253
pull_request: https://github.com/python/cpython/pull/2

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-10 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset b613132861839b6d05b67138842b579e1af29f9c by Miss Islington (bot) 
in branch '3.10':
bpo-44342: [Enum] changed pickling from by-value to by-name (GH-26658) 
(GH-26660)
https://github.com/python/cpython/commit/b613132861839b6d05b67138842b579e1af29f9c


--

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-10 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 62f1d2b3d7dda99598d053e10b785c463fdcf591 by Ethan Furman in 
branch 'main':
bpo-44342: [Enum] changed pickling from by-value to by-name (GH-26658)
https://github.com/python/cpython/commit/62f1d2b3d7dda99598d053e10b785c463fdcf591


--

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-10 Thread Ethan Furman


Change by Ethan Furman :


--
keywords: +patch
pull_requests: +25244
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26658

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44356] Multiple enum mixins not allowed even when they have the same datatype

2021-06-10 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 304ec53b53021ceddf62a38e66a06aed37e2ac41 by Miss Islington (bot) 
in branch '3.9':
bpo-44356: [Enum] allow multiple data-type mixins if they are all the same 
(GH-26649) (GH-26652)
https://github.com/python/cpython/commit/304ec53b53021ceddf62a38e66a06aed37e2ac41


--

___
Python tracker 
<https://bugs.python.org/issue44356>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44356] Multiple enum mixins not allowed even when they have the same datatype

2021-06-10 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 01286017c3345e2b8a0af2bd48f6eb2087693a82 by Miss Islington (bot) 
in branch '3.10':
bpo-44356: [Enum] allow multiple data-type mixins if they are all the same 
(GH-26649) (GH-26653)
https://github.com/python/cpython/commit/01286017c3345e2b8a0af2bd48f6eb2087693a82


--

___
Python tracker 
<https://bugs.python.org/issue44356>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-10 Thread Ethan Furman


Ethan Furman  added the comment:

Looking into this I think the root of the problem is the way `reduce` is 
handled -- currently, Enum's `__reduce_ex__` works by returning the class, and 
the value to use to lookup the member.  Because that lookup can fail with 
complex enums, EnumType will sabotage `reduce` if it can't find support in the 
new enum class.

However, if `__reduce_ex__` working by returning

`getattr, (self.__class, self._name_)`

then we should be fine, as that should never fail.

--

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44242] enum.IntFlag regression: missing values cause TypeError

2021-06-10 Thread Ethan Furman


Ethan Furman  added the comment:

Thank you everyone for your help.

--
priority: release blocker -> 
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11

___
Python tracker 
<https://bugs.python.org/issue44242>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44356] Multiple enum mixins not allowed even when they have the same datatype

2021-06-10 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 8a4f0850d75747af8c96ca0e7eef1f5c1abfba25 by Ethan Furman in 
branch 'main':
bpo-44356: [Enum] allow multiple data-type mixins if they are all the same 
(GH-26649)
https://github.com/python/cpython/commit/8a4f0850d75747af8c96ca0e7eef1f5c1abfba25


--

___
Python tracker 
<https://bugs.python.org/issue44356>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44342] enum with inherited type won't pickle

2021-06-10 Thread Ethan Furman


Change by Ethan Furman :


--
priority: normal -> high
versions: +Python 3.11

___
Python tracker 
<https://bugs.python.org/issue44342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44356] Multiple enum mixins not allowed even when they have the same datatype

2021-06-10 Thread Ethan Furman


Change by Ethan Furman :


--
title: Abstract enum mixins not allowed -> Multiple enum mixins not allowed 
even when they have the same datatype

___
Python tracker 
<https://bugs.python.org/issue44356>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44356] Multiple enum mixins not allowed even when they have the same datatype

2021-06-10 Thread Ethan Furman


Change by Ethan Furman :


--
keywords: +patch
pull_requests: +25235
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26649

___
Python tracker 
<https://bugs.python.org/issue44356>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44356] Abstract enum mixins not allowed

2021-06-10 Thread Ethan Furman


Ethan Furman  added the comment:

Since I like puzzles, here is a working LenientStrEnum:

class LenientStrEnum(str, Enum):
#
def __init__(self, *args):
self._valid = True
#
@classmethod
def _missing_(cls, value):
logger.warning(
f"[{cls.__name__}] encountered an unknown value!\n"
f"Luckily I'm a LenientStrEnum, so I won't crash just yet.\n"
f"You might want to add a new case though.\n"
f"Value was: '{value}'"
)
unknown = cls._member_type_.__new__(cls, value)
unknown._valid = False
unknown._name_ = value.upper()
unknown._value_ = value
cls._member_map_[value] = unknown
return unknown
#
@property
def valid(self):
return self._valid

`_member_map_` is not guaranteed, but is unlikely to change.

--

___
Python tracker 
<https://bugs.python.org/issue44356>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44242] enum.IntFlag regression: missing values cause TypeError

2021-06-10 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 749648609de89f14581190ea34b9c0968787a701 by Ethan Furman in 
branch '3.10':
[3.10] bpo-44242: [Enum] remove missing bits test from Flag creation (GH-26586) 
(GH-26635)
https://github.com/python/cpython/commit/749648609de89f14581190ea34b9c0968787a701


--

___
Python tracker 
<https://bugs.python.org/issue44242>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44242] enum.IntFlag regression: missing values cause TypeError

2021-06-09 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +25221
pull_request: https://github.com/python/cpython/pull/26635

___
Python tracker 
<https://bugs.python.org/issue44242>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



<    1   2   3   4   5   6   7   8   9   10   >