[issue27182] PEP 519 support in the stdlib

2016-06-02 Thread Ethan Furman
Ethan Furman added the comment: importlib: issue26667 -- ___ Python tracker <http://bugs.python.org/issue27182> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27184] Support path objects in the nt module

2016-06-02 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: brett.cannon, ethan.furman, serhiy.storchaka priority: normal severity: normal stage: test needed status: open title: Support path objects in the nt module type: behavior versions: Python 3.6 ___ Python tracker

[issue27182] PEP 519 support in the stdlib

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

[issue27182] PEP 519 support in the stdlib

2016-06-02 Thread Ethan Furman
Changes by Ethan Furman : -- dependencies: +Support Path objects in the posix module, Support path objects in the nt module, Update importlib to accept pathlib.Path objects type: -> behavior versions: +Python 3.6 ___ Python tracker &l

[issue27182] PEP 519 support in the stdlib

2016-06-02 Thread Ethan Furman
Changes by Ethan Furman : -- type: behavior -> enhancement ___ Python tracker <http://bugs.python.org/issue27182> ___ ___ Python-bugs-list mailing list Un

[issue27184] Support path objects in the nt module

2016-06-02 Thread Ethan Furman
Changes by Ethan Furman : -- type: behavior -> enhancement ___ Python tracker <http://bugs.python.org/issue27184> ___ ___ Python-bugs-list mailing list Un

[issue27182] PEP 519 support in the stdlib

2016-06-02 Thread Ethan Furman
Ethan Furman added the comment: os.fspath(): issue27186 -- dependencies: +add os.fspath() ___ Python tracker <http://bugs.python.org/issue27182> ___ ___ Python-bug

[issue27186] add os.fspath()

2016-06-02 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: brett.cannon, ethan.furman, serhiy.storchaka priority: normal severity: normal stage: test needed status: open title: add os.fspath() type: enhancement versions: Python 3.6 ___ Python tracker <h

[issue27182] PEP 519 support in the stdlib

2016-06-02 Thread Ethan Furman
Ethan Furman added the comment: Nope. There is a posixpath.py and an ntpath.py, and they are not the same. -- ___ Python tracker <http://bugs.python.org/issue27

[issue26266] add classattribute to enum to handle non-Enum attributes

2016-06-02 Thread Ethan Furman
Ethan Furman added the comment: One possible downside to the `classattribute` route is that we have a descriptor whose only purpose is to shield the item from becoming a member; the up-side is that it's simple to implement. Another possibility is `skip`: class skip: ""&quo

[issue27184] Support path objects in the ntpath module

2016-06-03 Thread Ethan Furman
Ethan Furman added the comment: @Serhy: Isn't that backwards? I would think that by doing os.path first most other libraries would not have to change. -- ___ Python tracker <http://bugs.python.org/is

[issue27186] add os.fspath()

2016-06-03 Thread Ethan Furman
Ethan Furman added the comment: Note: My schedule changed -- I won't be at the sprints today, but tomorrow. I'll finish reviewing these patches and commit this afternoon if no one beats me to it. -- ___ Python tracker <http://bu

[issue27182] PEP 519 support in the stdlib

2016-06-03 Thread Ethan Furman
Ethan Furman added the comment: Sorry, Serhiy, I had my module names mixed up. `nt` and `posix` are the same, but `ntpath` and `posixpath` are not (I may have those first two names wrong again, but hopefully you get the idea). -- ___ Python tracker

[issue27184] Support path objects in the ntpath module

2016-06-03 Thread Ethan Furman
Ethan Furman added the comment: The expected scenario, and the purpose of os.fspath(), is to enable high-level libraries to not know or care if they receive a pathlib object or a string. In other words, they already have os.path.join() and os.path.split() calls, and currently break noisily if

[issue27186] add os.fspath()

2016-06-04 Thread Ethan Furman
Ethan Furman added the comment: Dusty: The pathlib tests looks like it's only testing the PurePath implementation; while this /should/ be sufficient, please add tests for the other classes as well. -- ___ Python tracker <http://bugs.py

[issue27182] PEP 519 support in the stdlib

2016-06-04 Thread Ethan Furman
Changes by Ethan Furman : -- Removed message: http://bugs.python.org/msg267280 ___ Python tracker <http://bugs.python.org/issue27182> ___ ___ Python-bugs-list m

[issue27186] add os.fspath()

2016-06-04 Thread Ethan Furman
Ethan Furman added the comment: New changeset 00991aa5fdb5 by Ethan Furman in branch 'default': issue27182: update fsencode and fsdecode for os.path(); patch by Dusty Phillips https://hg.python.org/cpython/rev/00991aa5fdb5 (had wrong issue #

[issue27186] add os.fspath()

2016-06-04 Thread Ethan Furman
Ethan Furman added the comment: Jelle: the DirEntry patch looks good so far, but it needs a test for a bytes path. -- ___ Python tracker <http://bugs.python.org/issue27

[issue27186] add os.fspath()

2016-06-04 Thread Ethan Furman
Ethan Furman added the comment: Jelle: We still need os.open if you would like to work on that. :) -- ___ Python tracker <http://bugs.python.org/issue27

[issue27182] PEP 519 support in the stdlib

2016-06-04 Thread Ethan Furman
Ethan Furman added the comment: Currently, os.fspath will raise an exception if the thing passed in is not str/bytes/PathLike, and that error message will proclaim that str or bytes or PathLike is required; however, this is not true in cases such as Path (which doesn't allow bytes)

[issue27186] add os.fspath()

2016-06-04 Thread Ethan Furman
Ethan Furman added the comment: os.path is actually two different modules: posixpath.py and ntpath.py posixpath.py is being tracked in issue26027 ntpath.py is being tracked in issue27184 -- ___ Python tracker <http://bugs.python.org/issue27

[issue27242] Clarify the use cases of NotImplemented in the docs

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

[issue25958] Implicit ABCs have no means of "anti-registration"

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

[issue27186] add os.fspath()

2016-06-15 Thread Ethan Furman
Ethan Furman added the comment: os.fspath() will be changed to ensure the output of calling obj.__fspath__() is a str or bytes object. So the final behavior of calling os.fspath() will be to return a str or bytes or to raise an exception. I'll update the code for this change, as well i

[issue23591] Add IntFlags

2016-06-21 Thread Ethan Furman
Ethan Furman added the comment: Just look briefly through your patches, and they look pretty good. I'll take a more in-depth look in the next couple weeks. (Feel free to ping again if you don't see any activity from me, and thanks for you

[issue27186] add os.fspath()

2016-06-24 Thread Ethan Furman
Ethan Furman added the comment: Brett, no worries. My time has been extremely limited. I'll get the other locations in the stdlib fixed sometime in the next two months if no one beats me to it. -- ___ Python tracker <http://bugs.py

[issue23591] Add IntFlags

2016-07-06 Thread Ethan Furman
Ethan Furman added the comment: Reviewing... -- ___ Python tracker <http://bugs.python.org/issue23591> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26988] Add AutoNumberedEnum to stdlib

2016-07-09 Thread Ethan Furman
Ethan Furman added the comment: There is one wrinkle with auto-numbering. Consider the following code: class Color(AutoNumberEnum): red green blue @property def cap_name(self): return self.name.upper() What happens with `property`? - `property` is looked up in the class

[issue26988] Add AutoNumberedEnum to stdlib

2016-07-09 Thread Ethan Furman
Ethan Furman added the comment: A standard feature of Enum is that either space separated strings or a list of strings is accepted any where either is. _sunder_ names are the ones reserved for Enum use (such as _value_, _name_, and soon _order_ (for py2/py3 compatible code

[issue26988] Add AutoNumberedEnum to stdlib

2016-07-09 Thread Ethan Furman
Ethan Furman added the comment: The problem with testing the type of object a name refers to outside the class is it then becomes more difficult to make that an Enum member: class AddressType(Enum): pobox mailbox # third-party po box property Having to assign a value to `property

[issue26988] Add AutoNumberedEnum to stdlib

2016-07-09 Thread Ethan Furman
Ethan Furman added the comment: I need names. `aenum` already has an `AutoNumberEnum` (the one from the docs, no magic) so I hate to use the same name for the stdlib version with different behavior. So I either need a different name for the stdlib version, or a different name for the aenum

[issue26988] Add AutoNumberedEnum to stdlib

2016-07-10 Thread Ethan Furman
Ethan Furman added the comment: I like AutoEnum. Another auto-related thought: one of the more common Enum questions on StackOverflow is how to automatically have the value be the stringified version of the name: class Huh(Enum): this that those Huh.this.name == Huh.this.value # True

[issue23591] Add IntFlags

2016-07-10 Thread Ethan Furman
Ethan Furman added the comment: I don't think I'll have this in before the next alpha (today? tomorrow?) but I'll get it merged in the next couple weeks (need to do some integration work with the other Enum enhancements). -- ___

[issue26988] Add AutoNumberedEnum to stdlib

2016-07-10 Thread Ethan Furman
Ethan Furman added the comment: Yeah, I think the public interface will just be the AutoEnum and AutoNameEnum style. --- > Will these features go into enum34? Not sure. At this point I have the stdlib enum, enum34 enum, and aenum enum. In terms of capability, aenum is the most advan

[issue26988] Add AutoNumberedEnum to stdlib

2016-07-10 Thread Ethan Furman
Ethan Furman added the comment: That brings up a really good point -- this feature requires the __prepare__ method of the metaclass, so it won't work in Python 2 any way. So, yeah, bug-fix-mostly mode for enum34. :) -- ___ Python tracker

[issue26988] Add AutoNumberedEnum to stdlib

2016-07-11 Thread Ethan Furman
Ethan Furman added the comment: If you are constructing your own base Enum type, which would you rather do? class BaseZeroEnum(Enum): "initial integer is 0" _start_ = 0 ... or class BaseZeroEnum(Enum, start=0): "initial integer is 0" ... ? Oh, and

[issue26988] Add AutoNumberedEnum to stdlib

2016-07-11 Thread Ethan Furman
Ethan Furman added the comment: Here's the code. I'll do the doc changes next. -- keywords: +patch Added file: http://bugs.python.org/file43694/issue26988.stoneleaf.01.patch ___ Python tracker <http://bugs.python.o

[issue27498] Regression in repr() of class object

2016-07-12 Thread Ethan Furman
Ethan Furman added the comment: This change was done in issue25548. -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue27498> ___ ___ Pytho

[issue27512] os.fspath is certain to crash when exception raised in __fspath__

2016-07-14 Thread Ethan Furman
Ethan Furman added the comment: > I ... reorganize the existing tests a little. Please don't. Moving tests around makes it harder for reviewers to see what actually changed. Rewriting tests to do the same thing as before also takes more work from reviewers as we have to verify the

[issue27512] os.fspath is certain to crash when exception raised in __fspath__

2016-07-14 Thread Ethan Furman
Ethan Furman added the comment: > I think such omissions are hard to predict and you won't know where is > the omission until you encounter it. So if you don't know, how do you > know what to put in the tests? True. > And if it is encountered and fixed, such errors s

[issue27524] Update os.path for PEP 519/__fspath__()

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

[issue26988] Add AutoNumberedEnum to stdlib

2016-07-15 Thread Ethan Furman
Ethan Furman added the comment: Okay, here's an updated patch with the doc changes. Once the main patch is committed I'm going to reorganize the docs a bit, but that's later. -- assignee: -> ethan.furman Added file: http://bugs.python.org/file43743/issue26988.

[issue26988] Add AutoNumberedEnum to stdlib

2016-07-15 Thread Ethan Furman
Ethan Furman added the comment: Oh, and yes, I'll fix the whole 80-column thing. ;) -- ___ Python tracker <http://bugs.python.org/issue26988> ___ ___ Pytho

[issue26380] Add an http method enum

2016-07-18 Thread Ethan Furman
Ethan Furman added the comment: That was the last nudge I needed. Thanks, everyone. -- assignee: -> ethan.furman resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python

[issue27607] Enums never match if imported from another file

2016-07-24 Thread Ethan Furman
Ethan Furman added the comment: Sylvia, if you have any control over the name of your zip files, please use something shorter. ;) The files inside are a 'main.py' and a 'module.py' -- notice there is no '__main__.py'. So it can't be executed as '

[issue27607] Enums never match if imported from another file

2016-07-24 Thread Ethan Furman
Ethan Furman added the comment: Oh, forgot to mention I also tried testing as just 'main.py' from inside the test directory (that's what accounted for one of the two error messages). -- ___ Python tracker <http://bugs.pyt

[issue26988] Add AutoNumberedEnum to stdlib

2016-08-02 Thread Ethan Furman
Ethan Furman added the comment: The 80-column thing isn't fixed yet, but I redid the patch: - removed AutoNameEnum since there was some question of casing, etc - redid the methodology of auto-generating values: instead of adding it all to the prepared namespace or the metaclass, I

[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-08-02 Thread Ethan Furman
Ethan Furman added the comment: Did a little rewording and trimming (and formatting). Tried to keep the ideas while not being so verbose. -- Added file: http://bugs.python.org/file43977/issue27242.stoneleaf.01.patch ___ Python tracker <h

[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-08-02 Thread Ethan Furman
Ethan Furman added the comment: Fixed the typos (thanks!), removed the self-reference, and went with "similar names and purposes". -- ___ Python tracker <http://bugs.python.o

[issue26988] Add AutoNumberedEnum to stdlib

2016-08-02 Thread Ethan Furman
Ethan Furman added the comment: Okay, I think I'm done making changes unless any more mistakes are found. Thanks everyone for the pushing, prodding, and feedback! -- Added file: http://bugs.python.org/file43986/issue26988.stoneleaf.05.

[issue27672] x fromat of % operator broken in Python 3.5.2

2016-08-03 Thread Ethan Furman
Ethan Furman added the comment: I'm not trying to rub salt in the wound, but it's a good idea (for all of us) to test our programs with "-W always" to see if any thing pops up: $ python3.4 -W always -c "'%x' % 3.14" sys:1: DeprecationWarning: automa

[issue26981] add compatibility shim for enum34 backport

2016-08-05 Thread Ethan Furman
Ethan Furman added the comment: Done in issue26988. -- resolution: -> fixed status: open -> closed superseder: -> Add AutoNumberedEnum to stdlib ___ Python tracker <http://bugs.python.or

[issue26988] Add AutoNumberedEnum to stdlib

2016-08-08 Thread Ethan Furman
Changes by Ethan Furman : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.org/issue26988> ___

[issue23591] Add Flags and IntFlags

2016-08-08 Thread Ethan Furman
Ethan Furman added the comment: Flags -> int-backed, but not ints; useful for pure Python flags IntFlags -> ints (like IntEnum); useful for interfacing with other systems Are there better names? -- title: Add IntFlags -> Add Flags and

[issue23591] Add Flags and IntFlags

2016-08-09 Thread Ethan Furman
Ethan Furman added the comment: The idea behind Flags is that they are easily combined enums. The advantage they have over IntFlags is they do not interact with integers, and they cannot have non-existing values used. By keeping the same API as IntFlags we only have two APIs instead of

[issue23591] Add Flags and IntFlags

2016-08-14 Thread Ethan Furman
Ethan Furman added the comment: IntFlags will be in before feature freeze. -- ___ Python tracker <http://bugs.python.org/issue23591> ___ ___ Python-bugs-list m

[issue23591] Add Flags and IntFlags

2016-08-14 Thread Ethan Furman
Ethan Furman added the comment: Currently, the patch has the main values pre-created (so identity works as expected), and combinations are created on the fly (like normal class instances) -- in which case identity cannot be relied upon. Once I have the basic work done, I'll go back and

[issue23591] Add Flags and IntFlags

2016-08-15 Thread Ethan Furman
Ethan Furman added the comment: Serhiy's patch is only for IntFlags, and my patch hasn't yet fully incorporated his (many thanks for decompose!) For IntFlags I do not expect to have very many instances alive at once, especially since not-bitwise operators will lose the IntFlag

[issue23591] Add Flags and IntFlags

2016-08-15 Thread Ethan Furman
Ethan Furman added the comment: The zero value is special in that it represents a flag with nothing set. Excluding it has its own problems, but if you have an argument for that behavior I'm listening. Any other non-Flag value is not allowed, and will raise an error (IntFlags won&#x

[issue23591] Add Flags and IntFlags

2016-08-15 Thread Ethan Furman
Ethan Furman added the comment: '.0' does not have a name unless the user defines it; similarly, '.-1' does not have a name unless the user defines it. For Flags, negative numbers are supported in order to specify which flags are desired, but the final representation will

[issue23591] Add Flags and IntFlags

2016-08-15 Thread Ethan Furman
Ethan Furman added the comment: The values used in Flags are an implementation detail. The expected, and supported, use is naming the flags: class Color(Flags): Red, Green, Blue even custom names can be set using this method: >>> class Color(enum.Flags): ... red, gr

[issue26988] Add AutoNumberedEnum to stdlib

2016-08-16 Thread Ethan Furman
Ethan Furman added the comment: added missing '#' -- ___ Python tracker <http://bugs.python.org/issue26988> ___ ___ Python-bugs-list mailing list Uns

[issue23591] enum: Add Flags and IntFlags

2016-08-17 Thread Ethan Furman
Ethan Furman added the comment: The repr is better -- which patch did you test? -- ___ Python tracker <http://bugs.python.org/issue23591> ___ ___ Python-bug

[issue26988] Add AutoNumberedEnum to stdlib

2016-08-17 Thread Ethan Furman
Ethan Furman added the comment: Raymond, I appreciate your review and your poll. I am open to removing AutoEnum, but would like to give it a couple more weeks of review. (I'll post on py-dev.) The only point you made that I will firmly refute is the "unexpected breakage": yo

[issue26988] Add AutoNumberedEnum to stdlib

2016-08-18 Thread Ethan Furman
Ethan Furman added the comment: Thank you, Raymond, David, Barry, John, etc. for your feedback. While I really like AutoEnum I can see that that much magic doesn't need to exist in the stdlib. Unfortunately, the alternatives aren't very pretty, so I'll leave the AutoNumberEnum

[issue26988] Add AutoNumberedEnum to stdlib

2016-08-19 Thread Ethan Furman
Ethan Furman added the comment: Vedran, you have some very interesting points. However, if you really want to champion this you'll need to take it to Python Ideas. -- ___ Python tracker <http://bugs.python.org/is

[issue26988] Add AutoNumberedEnum to stdlib

2016-08-19 Thread Ethan Furman
Ethan Furman added the comment: No magic, but a whole heap of extra boiler-plate. :( -- ___ Python tracker <http://bugs.python.org/issue26988> ___ ___ Python-bug

[issue26988] Add AutoNumberedEnum to stdlib

2016-08-20 Thread Ethan Furman
Changes by Ethan Furman : -- stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.org/issue26988> ___ ___ Python-bugs-list

[issue26266] add classattribute to enum to handle non-Enum attributes

2016-08-20 Thread Ethan Furman
Ethan Furman added the comment: We'll keep the stdlib version simple. -- resolution: -> rejected stage: needs patch -> resolved status: open -> closed ___ Python tracker <http://bugs.pyth

[issue27607] Importing the main module twice leads to two incompatible instances

2016-08-20 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: -ethan.furman ___ Python tracker <http://bugs.python.org/issue27607> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26571] turtle regression in 3.5

2016-08-20 Thread Ethan Furman
Ethan Furman added the comment: Serhiy, is this a quick fix you can get in? -- ___ Python tracker <http://bugs.python.org/issue26571> ___ ___ Python-bugs-list m

[issue26981] add compatibility shim for enum34 backport

2016-08-20 Thread Ethan Furman
Ethan Furman added the comment: Issue 26988 reverted. Need to add shim here. -- resolution: fixed -> status: closed -> open ___ Python tracker <http://bugs.python.org/i

[issue26981] add compatibility shim for enum34 backport

2016-08-20 Thread Ethan Furman
Changes by Ethan Furman : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue26981] add compatibility shim for enum34 backport

2016-08-20 Thread Ethan Furman
Ethan Furman added the comment: Thanks! -- ___ Python tracker <http://bugs.python.org/issue26981> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23591] enum: Add Flags and IntFlags

2016-08-30 Thread Ethan Furman
Ethan Furman added the comment: Patch includes tests, but not docs. >From a previous comment: --- > As it stands, Weird(7) would be , and if A was not > defined an error would be raised. Actually, it would be since BC has a higher value than A. -- stage:

[issue23591] enum: Add Flags and IntFlags

2016-08-30 Thread Ethan Furman
Ethan Furman added the comment: Raymond, thanks for your support. I am happy to have a flags variant. The advice to wait and let Enum mature instead of adding the Flag variant at the beginning was sound, and we have a better product to show for it now. The four base Enum-type classes will

[issue23591] enum: Add Flags and IntFlags

2016-08-30 Thread Ethan Furman
Ethan Furman added the comment: Since we're using re as the sample, here's where re.I is defined: Lib/re.py: - I = IGNORECASE = sre_compile.SRE_FLAG_IGNORECASE # ignore case As already mentioned, re.I results in 2, and a re.compile object is not usable as a re flag. > Al

[issue17615] String comparison performance regression

2013-04-02 Thread Ethan Furman
Ethan Furman added the comment: As Ian Kelly said on Python-List: Micro-benchmarks like the ones [jmf] have been reporting are *useful* when it comes to determining what operations can be better optimized, but they are not *important* in and of themselves. What is important is that actual

[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-04-05 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +stoneleaf ___ Python tracker <http://bugs.python.org/issue17576> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17853] class construction name resolution broken in functions

2013-04-27 Thread Ethan Furman
New submission from Ethan Furman: In playing with metaclasses for the ongoing Enum saga, I tried having the metaclass insert an object into the custom dict (aka namespace) returned by __prepare__; this object has the same name as the to-be-created class. An example: class Season(Enum

[issue17853] class construction name resolution broken in functions

2013-04-27 Thread Ethan Furman
Ethan Furman added the comment: One more data point to truly demonstrate that something is wrong: --> def test(): ... class Season(Enum): ... print(locals()) ... Season = locals()['Season'] ... print(locals()) ... -->

[issue17853] class construction name resolution broken in functions

2013-04-27 Thread Ethan Furman
Ethan Furman added the comment: On 04/27/2013 02:01 PM, Mark Dickinson wrote: > > Mark Dickinson added the comment: > > Isn't this just a consequence of Python's usual name-lookup rules? In this > code: > > def test(): > class Season(Enu

[issue17853] class construction name resolution broken in functions

2013-04-27 Thread Ethan Furman
Ethan Furman added the comment: I guess the question is: Because Python can no longer know if the name has been inserted via __prepare__ it has to go through the whole CLOSURE business, but will changing the LOAD_DEREF to a LOAD_GLOBAL (only for items inside a class def) do the trick

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-27 Thread Ethan Furman
Ethan Furman added the comment: Perhaps you and Benjamin should discuss that. :) I just read a thread on core-mentors about when a bug is fixed or not -- considering that the behavior is plain wrong, that workarounds will still work even if the bug is fixed, why shouldn't we fix it ev

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-27 Thread Ethan Furman
Ethan Furman added the comment: Nick, thanks for the explanation. Benjamin, I was referring to Nick taking 3.3 and 3.2 off the issue and leaving 3.4, and you reversing it. ;) Sorry for the confusion -- I just reread my post and the words there didn't match the ideas in my head at the

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-28 Thread Ethan Furman
Ethan Furman added the comment: Thanks, Benjamin. Looking at that patch I realize the fix was way beyond my current core-hacking skills. -- ___ Python tracker <http://bugs.python.org/issue17

[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-09 Thread Ethan Furman
New submission from Ethan Furman: PEP-0435 has been approved! Now for lots of code review. -- assignee: docs@python components: Documentation, Library (Lib), Tests files: ref435.py hgrepos: 189 messages: 188812 nosy: barry, docs@python, eli.bendersky, stoneleaf priority: normal

[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-10 Thread Ethan Furman
Ethan Furman added the comment: Here it is (I hope ;) . -- keywords: +patch Added file: http://bugs.python.org/file30192/pep-435.patch ___ Python tracker <http://bugs.python.org/issue17

[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-10 Thread Ethan Furman
Ethan Furman added the comment: Incorporated comments. -- Added file: http://bugs.python.org/file30195/pep-0435_2.patch ___ Python tracker <http://bugs.python.org/issue17

[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-10 Thread Ethan Furman
Changes by Ethan Furman : -- hgrepos: -189 ___ Python tracker <http://bugs.python.org/issue17947> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-10 Thread Ethan Furman
Ethan Furman added the comment: More adjustments due to review. -- Added file: http://bugs.python.org/file30202/pep-0435_3.patch ___ Python tracker <http://bugs.python.org/issue17

[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-10 Thread Ethan Furman
Ethan Furman added the comment: Round 4. I wonder if I should have used two digits to number the patches. ;) -- Added file: http://bugs.python.org/file30209/pep-0435_4.patch ___ Python tracker <http://bugs.python.org/issue17

[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-11 Thread Ethan Furman
Ethan Furman added the comment: Eli, The original _StealthProperty checked to see if it was being called on instance or class, and if it was the class it invoked __getattr__ to attempt a lookup for an enum member. Your version does not check, but, ironically, the exception raised is

[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-11 Thread Ethan Furman
Ethan Furman added the comment: regrtest framework now supported (had to change the module name I was passing in from '__main__' to __name__). -- ___ Python tracker <http://bugs.python.o

[issue17954] Support creation of extensible enums through metaclass subclassing

2013-05-11 Thread Ethan Furman
Ethan Furman added the comment: I'm sure this is a dumb question, but I have lots of them so thought I'd share. Can this issue be resolved simply by making the `_get_mixins` method `get_mixins`? -- nosy: +ethan.furman ___ Python trac

[issue17959] Alternate approach to aliasing for PEP 435

2013-05-12 Thread Ethan Furman
Ethan Furman added the comment: Another approach to handling this, and other, issues is to allow options to EnumMeta. My original aenum code had the default Enum class as unordered, no duplicates allowed, non-indexable, etc., but then allowed options to be passed in such as DUPLICATES to

[issue17954] Support creation of extensible enums through metaclass subclassing

2013-05-12 Thread Ethan Furman
Ethan Furman added the comment: Make it simpler: class EnumMeta(): allow_subclass = False class MyEnumMeta(EnumMeta): allow_subclass = True -- ___ Python tracker <http://bugs.python.org/issue17

[issue17961] Use enum names as values in enum.Enum convenience API

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

[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-12 Thread Ethan Furman
Ethan Furman added the comment: After more thought, I think we should leave the shortened version of _StealthProperty as is. The reasoning being that if _StealthProperty does the __getattr__ lookup itself, and fails, it will return an AttributeError... and then Python will use __getattr__

[issue17961] Use enum names as values in enum.Enum convenience API

2013-05-12 Thread Ethan Furman
Ethan Furman added the comment: In flufl.enum integers also made since as that was the default back-end data type. Currently, the functional method allows a type declaration. The behavior there could be tweaked such that no specification meant no value (a truly valueless enum!), type=int

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