[issue18635] Enum sets _member_type_ to instantiated values but not the class

2013-08-02 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- assignee: - ethan.furman nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18635

[issue18635] Enum sets _member_type_ to instantiated values but not the class

2013-08-02 Thread Ethan Furman
Ethan Furman added the comment: Ah, so the Enum class has the mixin class as wall as / instead of the Enum member (which should find it via normal attribute lookup). I have no problem with that. I'll need to make a couple more changes to the code, add a test, etc., etc. It won't make

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-08-02 Thread Ethan Furman
Ethan Furman added the comment: I'll check you patch later against big numbers (which is where I had difficulties). If it works I'll try to make it more complete. If it doesn't, I've been working on just extraction the Enum member's value and using that (works fine on the Python side

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-08-02 Thread Ethan Furman
Ethan Furman added the comment: I don't think my idea of always extracting .value is grandiose (and didn't take that long to implement on the Python side), but it is definitely forcing me to learn more about C and how Python is put together. It this point I have successfully imported Enum

[issue18635] Enum sets _member_type_ to instantiated values but not the class

2013-08-02 Thread Ethan Furman
Ethan Furman added the comment: I also admit to being curious as to the reason it is useful, especially since it is, at this point, an implementation detail. Even so, it still makes more sense to have that attribute on the class instead of the instance

[issue18545] enum always runs member_type when use_args is True

2013-07-24 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- assignee: - ethan.furman nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18545

[issue18508] enum.Enum population of _value2member_map does not match fallback search

2013-07-19 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- keywords: +patch stage: - patch review Added file: http://bugs.python.org/file30986/issue18510.stoneleaf.01.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18508

[issue18508] enum.Enum population of _value2member_map does not match fallback search

2013-07-19 Thread Ethan Furman
Ethan Furman added the comment: Cleaner patch. -- Added file: http://bugs.python.org/file30987/issue18510.stoneleaf.02.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18508

[issue18508] enum.Enum population of _value2member_map does not match fallback search

2013-07-19 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- assignee: - ethan.furman nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18508

[issue18510] if Enum member value is not hashable an exception is raised

2013-07-19 Thread Ethan Furman
New submission from Ethan Furman: While working on issue #18508 I stumbled across this: Traceback (most recent call last): ... File /usr/local/lib/python3.4/enum.py, line 417, in __new__ if value in cls._value2member_map: TypeError: unhashable type: 'list' I'll wrap it in a try-except

[issue18510] dict.__contains__ raises exception instead of returning False

2013-07-19 Thread Ethan Furman
Ethan Furman added the comment: Commenting further: some_key in dict is conceptually the same as some_key in dict.keys() which /would/ return False for an unhashable key -- at least it did in 2.x; for 3.x you have to say some_key in list(dict.keys()) which seems like a step

[issue18510] dict.__contains__ and dict.keys().__contains__ raises exception instead of returning False

2013-07-19 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- title: dict.__contains__ raises exception instead of returning False - dict.__contains__ and dict.keys().__contains__ raises exception instead of returning False ___ Python tracker rep

[issue18510] dict.__contains__ raises exception instead of returning False

2013-07-19 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- assignee: ethan.furman - versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18510

[issue18305] [patch] Fast sum() for non-numbers

2013-07-11 Thread Ethan Furman
Ethan Furman added the comment: So making this a speed-up for generic objects using __iadd__ is out. The only question remaining is: is it worth special casing a few specific objects (list, tuple, str) to optimise performance? The str question has already been answered: it's special cased

[issue18305] [patch] Fast sum() for non-numbers

2013-07-10 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18305 ___ ___ Python-bugs-list

[issue18042] Provide enum.unique class decorator

2013-06-29 Thread Ethan Furman
Ethan Furman added the comment: Integrated comments. -- Added file: http://bugs.python.org/file30730/unique.stoneleaf.02.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18042

[issue9938] Documentation for argparse interactive use

2013-06-28 Thread Ethan Furman
Ethan Furman added the comment: It doesn't look like xuanji has signed a CLA. Should we create a new issue, and have someone else create a new patch, and let this issue just be about the docs? -- nosy: +ethan.furman ___ Python tracker rep

[issue18042] Provide enum.unique class decorator

2013-06-28 Thread Ethan Furman
Ethan Furman added the comment: unique() added to enum.py; tests added; docs updated. If no complaints within a few days I'll push them through. -- keywords: +patch Added file: http://bugs.python.org/file30722/unique.stoneleaf.01.patch ___ Python

[issue18042] Provide enum.unique class decorator

2013-06-28 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18042 ___ ___ Python-bugs-list

[issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable

2013-06-26 Thread Ethan Furman
Ethan Furman added the comment: For the curious, here are all the tracebacks: -- json.dumps(a) Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python3.3/json/__init__.py, line 236, in dumps return _default_encoder.encode(obj) File /usr/lib/python3.3/json

[issue18173] Add MixedTypeKey to reprlib

2013-06-26 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18173 ___ ___ Python-bugs-list

[issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable

2013-06-25 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18303 ___ ___ Python-bugs-list

[issue18281] tarfile defines stat constants

2013-06-22 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18281 ___ ___ Python-bugs-list

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-21 Thread Ethan Furman
Ethan Furman added the comment: I'd be in favor of the __protocol__ route first and the PEP 443 route second. The problem with just tacking in `str(int(value))` or `str(float(value))` is where does it stop? StrEnum, TupleEnum, BytesEnum, ComplexEnum, SomeOtherInterestingConstantEnum, etc

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-21 Thread Ethan Furman
Ethan Furman added the comment: On 06/21/2013 07:49 PM, Guido van Rossum wrote: Eli Bendersky added the comment: Practically speaking, what should be done to make enum play well with JSON without writing new PEPs? I think we still want to convert those stdlib constants to IntEnums

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-21 Thread Ethan Furman
Ethan Furman added the comment: Guido van Rossum added the comment: Yes for float() -- but for str() it would seem redundant? (Or what's the context?) If a user has class Color(StrEnum): red = 'ff' green = '00ff00' blue = 'ff' .. .. .. oh. `str

[issue17961] Use enum names as values in enum.Enum() functional API

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: Enum members have two pieces of easily accessible information: `name` and `value`. The name is taken from the attribute the value is assigned to; the value, obviously, is the value assigned. The question, then, is what should happen when the function syntax

[issue18042] Provide enum.unique class decorator

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: I haven't seen any discouraging words regarding the decorator. If no one has any compelling reasons why it shouldn't be added, I'll craft a version and put it in (only real difference with Nick's would be catching all the duplicates at once instead of one

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: Nick, in your example it looks like json is using the __str__ for int, but the __repr__ for float -- is this correct? -- assignee: - ethan.furman nosy: +eli.bendersky, ethan.furman ___ Python tracker rep

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: I have no problem with leaving __str__ as the inherited type's, and just keeping the __repr__ as the enum add-on; this could be one of the differences between a pure Enum and a hybrid Enum. Is it safe to change the json behaviour back to using __str__

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: Eric, The pickle support is solely in Enum. No changes were made to pickles. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18264

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: I was unable to find any references to previous problems with json and floats. A quick-n-dirty patch yields the following: -- from json import dumps, loads -- from enum import Enum -- class FE(float, Enum): ... pass ... -- class Test(FE): ... one = 1.0

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ezio.melotti, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18264 ___ ___ Python

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Ethan Furman
Ethan Furman added the comment: Here's the relevant routine from _json.c: - static PyObject * encoder_encode_float(PyEncoderObject *s, PyObject *obj) { /* Return the JSON representation of a PyFloat */ double i = PyFloat_AS_DOUBLE(obj

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

2013-06-14 Thread Ethan Furman
Ethan Furman added the comment: Well, that made me laugh first thing in the morning! I had nuked and redone my clone, and yeah, forgot to re-add the files. :/ Trying again... Commit message was okay? -- ___ Python tracker rep...@bugs.python.org

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

2013-06-11 Thread Ethan Furman
Ethan Furman added the comment: Final (hopefully! ;) patch. I stuck the toc reference in datatypes. If no more edits are necessary I'll commit on Friday (three days from now). -- Added file: http://bugs.python.org/file30548/pep-0435.12.stoneleaf.patch

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

2013-06-09 Thread Ethan Furman
Ethan Furman added the comment: Hopefully the last update. :) -- Added file: http://bugs.python.org/file30512/pep-0435.11.stoneleaf.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17947

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

2013-06-08 Thread Ethan Furman
Ethan Furman added the comment: Hopefully the final bit of code, plus docs. Code changes: _names_ are reserved Doc changes (different from the PEP): examples of AutoEnum, UniqueEnum, and OrderedEnum -- Added file: http://bugs.python.org/file30504/pep-0435.08.stoneleaf.patch

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

2013-06-08 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: Removed file: http://bugs.python.org/file30504/pep-0435.08.stoneleaf.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17947

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

2013-06-08 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: Added file: http://bugs.python.org/file30505/pep-0435.08.stoneleaf.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17947

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

2013-06-08 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: Removed file: http://bugs.python.org/file30505/pep-0435.08.stoneleaf.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17947

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

2013-06-08 Thread Ethan Furman
Ethan Furman added the comment: Apologies for the noise -- was having trouble getting the correct patch attached. :/ -- Added file: http://bugs.python.org/file30506/pep-0435.09.stoneleaf.patch ___ Python tracker rep...@bugs.python.org http

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

2013-06-08 Thread Ethan Furman
Ethan Furman added the comment: So, which is better? To have a @unique class decorator as part of the module, or to have a UniqueEnum recipe in the docs? A decorator is immediately usable, but requires remembering an extra line of code. An example requires being put into a local utility

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

2013-06-08 Thread Ethan Furman
Ethan Furman added the comment: Good idea, thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17947 ___ ___ Python-bugs-list mailing list

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

2013-06-08 Thread Ethan Furman
Ethan Furman added the comment: Doc updates are in. I removed the 'unique, constant' from the first line of the intro, as neither of those things are necessarily true. -- Added file: http://bugs.python.org/file30511/pep-0435.10.stoneleaf.patch

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

2013-06-08 Thread Ethan Furman
Ethan Furman added the comment: Hmm -- I was confusing member names with member values; I'll put 'unique' back in. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17947

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

2013-05-29 Thread Ethan Furman
Ethan Furman added the comment: Working on documentation... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17947 ___ ___ Python-bugs-list

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

2013-05-26 Thread Ethan Furman
Ethan Furman added the comment: Wow. I definitely felt like an apprentice after reading the changes. Thanks, Eli, that looks worlds better! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17947

[issue18042] Provide enum.unique class decorator

2013-05-23 Thread Ethan Furman
Ethan Furman added the comment: This is certainly an effective method, but it places safety off by default. I would rather have a system that was from duplicates by default but had an easy override. The method I had in place in my original code was something like: class Color(Enum, options

[issue18042] Provide enum.unique class decorator

2013-05-23 Thread Ethan Furman
Ethan Furman added the comment: I'm not giving up hope yet. Plenty of Python features no longer work the way they did when their PEP was accepted. ;) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18042

[issue18042] Provide enum.unique class decorator

2013-05-23 Thread Ethan Furman
Ethan Furman added the comment: Oh. Well, I like your decorator. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18042 ___ ___ Python-bugs

[issue18011] Inconsistency between b32decode() documentation, docstring and code

2013-05-20 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18011 ___ ___ Python-bugs-list

[issue18009] os.write.__doc__ is misleading

2013-05-18 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18009 ___ ___ Python-bugs-list

[issue18001] TypeError: dict is not callable in ConfigParser.py

2013-05-17 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18001 ___ ___ Python-bugs-list

[issue18001] TypeError: dict is not callable in ConfigParser.py

2013-05-17 Thread Ethan Furman
Ethan Furman added the comment: Your interest if fixing Python is appreciated, but you need to verify that a bug actually exists first: Python 2.7.3 (default, Sep 26 2012, 21:51:14) [GCC 4.7.2] on linux2 Type help, copyright, credits or license for more information. -- class RawConfigParser

[issue3489] add rotate{left,right} methods to bytearray

2013-05-17 Thread Ethan Furman
Ethan Furman added the comment: Antoine, do you want to pursue, or can we close this? -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3489

[issue515074] Extended storage in new-style classes

2013-05-17 Thread Ethan Furman
Ethan Furman added the comment: David, is this still a need? Or, put another way, has Python change enough in the last 11 years that you can now do what you wanted? -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http

[issue8297] AttributeError message text should include module name

2013-05-17 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8297 ___ ___ Python-bugs-list

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

2013-05-14 Thread Ethan Furman
Ethan Furman added the comment: Got the pickle issues worked out. Added super to the metaclass' __new__. Checking for illegal names of members and raising ValueError if any are found (I know, I know, safety checks! But such an enum is broken from the getgo so I see no reason to allow those

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

2013-05-13 Thread Ethan Furman
Ethan Furman added the comment: So the repr will look like: Color.red: 'red' ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17961

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue17954

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

2013-05-12 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17961 ___ ___ Python-bugs-list

[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

[issue17954] Support creation of extensible enums through metaclass subclassing

2013-05-12 Thread Ethan Furman
Ethan Furman added the comment: Not trying to push, but if I don't write it down now, I'll forget later. ;) What does adding new members gain us? If I have a func xyz() that's expecting a Color, a MoreColor will work sometimes and blow up other times. Or are you saying that we may have

[issue17963] Deprecate the frame hack for implicitly getting module details

2013-05-12 Thread Ethan Furman
Ethan Furman added the comment: I believe Guido will be happy to replace the frame hack once we have something better, such as a way to implicitly (or explicitly in the case of helper functions) pass the calling module's name. Maybe a global __calling_module__ that a function can look

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

2013-05-12 Thread Ethan Furman
Ethan Furman added the comment: Here's the latest patch. Note that the functional API portion is broken, and I'll get back to that this evening. Please only comment on the working code. ;) I'll make that _MemborOrProperty name change then as well. -- Added file: http

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue17947

[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 tracker rep

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

2013-05-10 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 rep...@bugs.python.org http://bugs.python.org/issue17947

[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 rep...@bugs.python.org http://bugs.python.org/issue17947

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

2013-05-10 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- hgrepos: -189 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17947 ___ ___ Python-bugs-list mailing

[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 rep...@bugs.python.org http://bugs.python.org/issue17947

[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 rep...@bugs.python.org http://bugs.python.org

[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 rep...@bugs.python.org http://bugs.python.org/issue17853

[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()) ... -- test() {'Season

[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(Enum): SPRING = Season() the class

[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 even

[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 time

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

2013-04-05 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +stoneleaf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17576 ___ ___ Python-bugs-list

[issue17615] String comparison performance regression

2013-04-02 Thread Ethan Furman
Ethan Furman added the comment: As Ian Kelly said on Python-List: quote 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

[issue15209] Re-raising exceptions from an expression

2012-12-08 Thread Ethan Furman
Ethan Furman added the comment: There is one typo and one error in the first paragraph of the patch: When raising a new exception (rather than using to bare ``raise`` to re-raise the ^ should be an 'a' exception currently being handled), the implicit exception chain can be made

[issue16246] Multiprocessing infinite loop on Windows

2012-10-16 Thread Ethan Furman
New submission from Ethan Furman: On Windows multiprocessing has a well known limitation: because there is no fork() new shells must be invoked, and if the call that ultimately starts multiprocessing is not guarded by an `if __name__ == '__main___'` check an infinite loops results and you

[issue16131] Pylauncher is being installed in Windows system folder

2012-10-04 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +stoneleaf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16131 ___ ___ Python-bugs-list

[issue14617] confusing docs with regard to __hash__

2012-09-11 Thread Ethan Furman
Ethan Furman added the comment: RC2 has just been released. Any chance of this getting in to the final release? Nobobdy has pointed out any problems with the last update... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue14617] confusing docs with regard to __hash__

2012-09-11 Thread Ethan Furman
Ethan Furman added the comment: R. David Murray wrote: I rewrote the section a bit differently than you did in your patch...if you think my changes are not an improvement please let me know. This line is incorrect: A class which defines its own :meth:`__hash__` that explicitly raises

[issue14617] confusing docs with regard to __hash__

2012-09-11 Thread Ethan Furman
Ethan Furman added the comment: Ethan Furman wrote: Ethan Furman added the comment: R. David Murray wrote: I rewrote the section a bit differently than you did in your patch...if you think my changes are not an improvement please let me know. This line is incorrect: A class which

[issue15209] Re-raising exceptions from an expression

2012-09-11 Thread Ethan Furman
Ethan Furman added the comment: Can we also get this committed before 3.3.0 final? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15209

[issue15209] Re-raising exceptions from an expression

2012-08-20 Thread Ethan Furman
Ethan Furman added the comment: Any problems with the current doc patch? If not, can it be applied before RC1? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15209

[issue14954] weakref doc clarification

2012-08-20 Thread Ethan Furman
Ethan Furman added the comment: Any problems with the current doc patch? If not, can it be applied before RC1? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14954

[issue14617] confusing docs with regard to __hash__

2012-08-20 Thread Ethan Furman
Ethan Furman added the comment: Any problems with the current doc patch? If not, can it be applied before RC1? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14617

[issue15510] textwrap.wrap('') returns empty list

2012-08-08 Thread Ethan Furman
Ethan Furman added the comment: Chris Jerdonek wrote: Here is an example on a paragraph with line breaks between paragraphs: s/paragraph/text/ def wrap_paras(text, width=70, **kwargs): ... lines = [line for para in text.splitlines() ... for line in wrap(para, width

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Ethan Furman
Ethan Furman added the comment: The documentation says, Returns a list of output lines; an empty list is not a list of lines. -- nosy: +stoneleaf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15510

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Ethan Furman
Ethan Furman added the comment: Not sure I would worry about fixing it in 2.7, although I don't have strong feelings about that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15510

[issue15510] textwrap.wrap('') returns empty list

2012-08-03 Thread Ethan Furman
Ethan Furman added the comment: Antoine Pitrou wrote: Antoine Pitrou added the comment: an empty list is not a list of lines Really? .splitlines() [] Really. -- ''.split('\n') [''] -- ___ Python tracker rep...@bugs.python.org http

<    13   14   15   16   17   18   19   >