[issue19979] Missing nested scope vars in class scope (bis)

2014-05-18 Thread Ethan Furman
Ethan Furman added the comment: Terry remarked: --- > I am puzzled by the opening statement there that > > from enum import Enum # I added this as necessary > class Season(Enum): > SPRING = Season() > > "works beautifully" at top level as it

[issue2506] Add mechanism to disable optimizations

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

[issue21561] help() on enum34 enumeration class creates only a dummy documentation

2014-05-23 Thread Ethan Furman
Ethan Furman added the comment: Good work. This bug was fixed in 3.4 with the inclusion of enum. It would definitely be good to fix in 2.7 as well. -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue21

[issue21561] help() on enum34 enumeration class creates only a dummy documentation

2014-05-23 Thread Ethan Furman
Ethan Furman added the comment: The problem will affect anything that uses the same mechanism as enum. It also affects (not verified) all versions of python up to 3.4 where it was fixed because enum exposed it. Besides which, I did not think a bug had to affect stdlib code in order to be

[issue21561] help() on enum34 enumeration class creates only a dummy documentation

2014-06-02 Thread Ethan Furman
Ethan Furman added the comment: I think something like the following, taken from http://bugs.python.org/issue19030#msg199920, shoud do the trick for something to test against: class Meta(type): def __getattr__(self, name): if name == 'ham': re

[issue21706] Add base for enumerations (Functional API)

2014-06-10 Thread Ethan Furman
Ethan Furman added the comment: That is certainly nicer than the current idiom: Animal = Enum('Animal', zip('ant bee cat dog'.split(), range(4))) -- assignee: -> ethan.furman ___ Python tracker <http://

[issue21706] Add base for enumerations (Functional API)

2014-06-10 Thread Ethan Furman
Ethan Furman added the comment: Playing devil's advocate: The issue is not so much the keystrokes saved as the improvement in reading and understanding what was intended. If you are happy with starting at 1 the idiom is easy to both write, read, and understand; but if you want some

[issue21738] Enum docs claim replacing __new__ is not possible

2014-06-12 Thread Ethan Furman
New submission from Ethan Furman: Replacing __new__ in an Enum subclass is not possible /in the subclass definition/, but is easily replaced via monkey-patching after the class has been defined. Docs need to be updated to reflect this. -- assignee: ethan.furman messages: 220372 nosy

[issue21773] Fix a NameError in test_enum

2014-06-16 Thread Ethan Furman
Ethan Furman added the comment: Right, I had copied that code from test_pydoc which is where 'print_diffs' is defined. A comment there says to use the now-included functionality in unittest, and some digging in the docs revealed that assertEqual uses diffs by default. -

[issue21793] httplib client/server status refactor

2014-06-17 Thread Ethan Furman
Ethan Furman added the comment: Left comments in reitvald about modifying the Enum used -- let me know if you have any questions about that. -- ___ Python tracker <http://bugs.python.org/issue21

[issue21738] Enum docs claim replacing __new__ is not possible

2014-06-19 Thread Ethan Furman
Ethan Furman added the comment: Common, no. And if the docs were silent on the matter that would be okay, but unfortunately the docs declare that it is not possible, which is just plain wrong. Patch also mentions _value_ as that is the supported interface when customizing __new__ methods

[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

[issue18986] Add a case-insensitive case-preserving dict

2013-09-12 Thread Ethan Furman
Ethan Furman added the comment: True, but how big a deal is that? For one, it seems questionable to have the presentation portion of the data be part of the key. For two, when presentation is important a separate list must be kept anyway to preseed the dict; so just use that list to cycle

[issue18986] Add a case-insensitive case-preserving dict

2013-09-12 Thread Ethan Furman
Ethan Furman added the comment: Right, sorry. -- ___ Python tracker <http://bugs.python.org/issue18986> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18989] reuse of enum names in class creation inconsistent

2013-09-13 Thread Ethan Furman
Ethan Furman added the comment: One cannot subclass an Enum that has already defined keys. -- ___ Python tracker <http://bugs.python.org/issue18989> ___ ___ Pytho

[issue18989] reuse of enum names in class creation inconsistent

2013-09-13 Thread Ethan Furman
Ethan Furman added the comment: Perhaps you meant, what if you define a key in a subclass that shadows a method/property in a parent class? I'm inclined to say that would be acceptable, since one reason for subclassing is to add or make changes to the parent class'

[issue18989] reuse of enum names in class creation inconsistent

2013-09-13 Thread Ethan Furman
Ethan Furman added the comment: In any other (normal) class, this works: == -->class Okay: ... red = 1 ... green = 2 ... blue = 3 ... red

[issue19011] Enum should have a __getattr__ that makes all the instances available from an instance

2013-09-13 Thread Ethan Furman
Ethan Furman added the comment: --> class Test: ... this = 'that' ... these = 'those' ... --> Test.this 'that' --> Test.this.these Traceback (most recent call last): Fi

[issue19011] Enum should have a __getattr__ that makes all the instances available from an instance

2013-09-13 Thread Ethan Furman
Ethan Furman added the comment: My apologies, you are correct. I am still against this for the Alice reason, but lets see what the others think. -- resolution: rejected -> status: closed -> open ___ Python tracker <http://bugs.p

[issue18989] reuse of enum names in class creation inconsistent

2013-09-13 Thread Ethan Furman
Ethan Furman added the comment: That is expressly forbidden in the PEP. Can we change it now? -- ___ Python tracker <http://bugs.python.org/issue18989> ___ ___

[issue18995] Enum does not work with reversed

2013-09-14 Thread Ethan Furman
Ethan Furman added the comment: Well, I totally messed up the commit message, but the code is now in place. Thanks, Vajrasky Kok! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python track

[issue18693] help() not helpful with enum

2013-09-14 Thread Ethan Furman
Ethan Furman added the comment: Okay, here's the patch after the inspect portion was committed in #18929. Summary: - added __objclass__ to each enum member - added __module__ to the class dir - aded any extra methods defined to the instance dir - changed _RouteClassAttributeToGetat

[issue19025] Deleting attribute of Enum gives misleading error message

2013-09-15 Thread Ethan Furman
Changes by Ethan Furman : -- assignee: -> ethan.furman ___ Python tracker <http://bugs.python.org/issue19025> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue19025] Deleting attribute of Enum gives misleading error message

2013-09-15 Thread Ethan Furman
Ethan Furman added the comment: Perhaps a section in the docs about the differences from typical Python classes is warranted: - Enum members are virtual - Enum members are singletons - new Enum members (aka instances of an Enum class) cannot be created - during class creation Enum

[issue19025] Deleting attribute of Enum gives misleading error message

2013-09-15 Thread Ethan Furman
Ethan Furman added the comment: As for the error messages (going in reverse order): == --> del cute_cat.name Traceback (most recent call last): ... AttributeError: can't delete a

[issue18989] reuse of enum names in class creation inconsistent

2013-09-15 Thread Ethan Furman
Ethan Furman added the comment: As David noted, this was discussed somewhere in the megathreads that was the Enum PEP discussion. As Georg noted changes to such a thoroughly discussed API should not be taken lightly. As Antoine noted the Enum class is more restricted than normal classes by

[issue18693] help() not helpful with enum

2013-09-15 Thread Ethan Furman
Ethan Furman added the comment: Two issues still remain: - custom behavior, as well as value and name, don't show in help - value and name, if defined as enum members, show up as data descriptors in

[issue19030] Make inspect.getmembers and inspect.classify_class_attrs Enum aware

2013-09-15 Thread Ethan Furman
New submission from Ethan Furman: Due to the odd nature of Enum classes and instances, the normal methods used by inspect.getmembers and inspect.classify_class_attrs are insufficient. By special casing Enum inside those two functions the correct information can be returned. Here is an

[issue19031] Make help() enum aware

2013-09-15 Thread Ethan Furman
New submission from Ethan Furman: Currently, if help() is called on an Enum member, it displays help for the class. While this is usually what one wants, it is not for Enums. -- messages: 197845 nosy: barry, eli.bendersky, ethan.furman priority: normal severity: normal status: open

[issue18693] help() not helpful with enum

2013-09-15 Thread Ethan Furman
Ethan Furman added the comment: Tracking inspect in issue19030. Tracking help in issue19031. -- ___ Python tracker <http://bugs.python.org/issue18693> ___ ___

[issue19030] Make inspect.getmembers and inspect.classify_class_attrs Enum aware

2013-09-15 Thread Ethan Furman
Ethan Furman added the comment: Attached patch yields these results: === Help on class Test in module __main__: class Test(enum.Enum) | Method resolution order: | Test | enum.Enum

[issue19030] Make inspect.getmembers and inspect.classify_class_attrs Enum aware

2013-09-15 Thread Ethan Furman
Ethan Furman added the comment: R David Murray said: > >Special casing Enum in inspect has a code smell to it. I agree, and I'm certainly open to other options. The flow at this point is: help() --> inspect.classify_class_attrs --> dir() --> Enum.__dir__ Because inspe

[issue19030] Make inspect.getmembers and inspect.classify_class_attrs Enum aware

2013-09-15 Thread Ethan Furman
Ethan Furman added the comment: I do not see one. I did post to PyDev asking about dir -- perhaps I should have given it a different title. -- ___ Python tracker <http://bugs.python.org/issue19

[issue19030] Make inspect.getmembers and inspect.classify_class_attrs Enum aware

2013-09-15 Thread Ethan Furman
Ethan Furman added the comment: Here's a crazy idea. :) The only reason the patch is tied to Enum is because of Enum's use of the _RouteClassAttributeToGetattr descriptor. If we had a module similar to functools, say classtools, we could flesh out _RouteClassAttributeToGetattr, re

[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors

2013-09-16 Thread Ethan Furman
Ethan Furman added the comment: Switching the order to try getattr first is going to make getting the doc from the descriptor problematic -- we have no way of knowing if the descriptor doc goes with the object we got back from getattr. Current patch adds VirtualAttribute to types, and reworks

[issue1615] descriptor protocol bug

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

[issue19040] Problems with overriding Enum.__new__

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

[issue1615] descriptor protocol bug

2013-09-17 Thread Ethan Furman
Ethan Furman added the comment: Benjamin Peterson added the comment: > > I consider this to be a feature. Properties can raise AttributeError to defer > to > __getattr__. Micah Friesen added the comment: > >I submit that this is not a feature - I can't imagine a real-wor

[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors

2013-09-18 Thread Ethan Furman
Ethan Furman added the comment: Okay, some slight reorganizing. Current patch gives preferential treatment to getattr, falling back on dict lookup if getattr raises an exception or if the resulting object's class is not found in the mro (including the metaclass mro). Amazingly, no

[issue19075] Add sorting algorithm visualization to turtledemo

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

[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors

2013-09-22 Thread Ethan Furman
Ethan Furman added the comment: Current patch has a little more code cleanup and a bunch more tests. I copied and adapted test_property to test_VirtualAttribute, and VirtualAttribute passes every test except the __slots__ test where __doc__ is not supposed to copy. I think the problem there

[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors

2013-09-22 Thread Ethan Furman
Changes by Ethan Furman : Added file: http://bugs.python.org/file31846/issue19030.stoneleaf.04.patch ___ Python tracker <http://bugs.python.org/issue19030> ___ ___ Pytho

[issue19025] Deleting attribute of Enum gives misleading error message

2013-09-22 Thread Ethan Furman
Ethan Furman added the comment: Okay, I changed my mind about __delattr__. Having it say "AttributeError: cannot delete Enum member" is certainly nicer than "AttributeError: MemberName" -- ___ Python tracker <http://bug

[issue19011] Enum should have a __getattr__ that makes all the instances available from an instance

2013-09-22 Thread Ethan Furman
Ethan Furman added the comment: Posted a message on PyDev, but unless I get feedback saying it's a bad idea, or I find some implementation issue, I'll go ahead and make the change. So either a doc patch or an enum patch will be

[issue19040] Problems with overriding Enum.__new__

2013-09-22 Thread Ethan Furman
Ethan Furman added the comment: How about this note after the AutoNumber example? .. note:: The :meth:`__new__` method, if defined, is used during creation of the Enum members; it is then replaced by Enum's :meth:`__new__` which is used after class creation for lookup of exi

[issue19040] Problems with overriding Enum.__new__

2013-09-22 Thread Ethan Furman
Ethan Furman added the comment: Yup, just trying to add some explanation on how it currently works. Drekin, I'm sure you've already figured this out, but for those who may read this in the future: what you need is a helper function: def OptionalEnum(value): "could also

[issue19011] Enum should have a __getattr__ that makes all the instances available from an instance

2013-09-24 Thread Ethan Furman
Ethan Furman added the comment: As discussed on PyDev[1], Enum members are bonafide class attributes, as in they show on the class, not on the instances. Documentation patch attached. [1] https://mail.python.org/pipermail/python-dev/2013-September/128874.html -- stage: -> pa

[issue19040] Problems with overriding Enum.__new__

2013-09-24 Thread Ethan Furman
Ethan Furman added the comment: Doc patch is in #19011. I'll close this one when that one is closed. -- ___ Python tracker <http://bugs.python.org/is

[issue19089] Windows: Broken Ctrl-D shortcut on Python 3

2013-09-25 Thread Ethan Furman
Ethan Furman added the comment: Ctrl-D has never work for me on Windows either. -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue19

[issue19040] Problems with overriding Enum.__new__

2013-09-27 Thread Ethan Furman
Changes by Ethan Furman : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue19148] Minor issues with Enum docs

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

[issue19156] Enum helper functions test-coverage

2013-10-04 Thread Ethan Furman
Changes by Ethan Furman : -- assignee: -> ethan.furman nosy: +ethan.furman stage: -> patch review ___ Python tracker <http://bugs.python.org/issue19156> ___ __

[issue19156] Enum helper functions test-coverage

2013-10-06 Thread Ethan Furman
Ethan Furman added the comment: Thanks for catching that, Cliff. -- ___ Python tracker <http://bugs.python.org/issue19156> ___ ___ Python-bugs-list mailin

[issue16938] pydoc confused by __dir__

2013-10-06 Thread Ethan Furman
Ethan Furman added the comment: = class Boom: def __dir__(self): return ['BOOM'] def __getattr__(self, name): if name =='BOOM': return 42 return super().__geta

[issue19075] Add sorting algorithm visualization to turtledemo

2013-10-06 Thread Ethan Furman
Ethan Furman added the comment: What are the requirements (if any) to get something added to demos? If not many, I'll spiffy up the code a bit (mostly make it go more than one round without having to restart). -- ___ Python tracker

[issue19031] Make help() enum aware

2013-10-06 Thread Ethan Furman
Ethan Furman added the comment: What I'd really like to see is for help to be smart enough to pick up the docstrings from instances if an instance has one. -- ___ Python tracker <http://bugs.python.org/is

[issue18281] tarfile defines stat constants

2013-10-06 Thread Ethan Furman
Ethan Furman added the comment: Christian, do you mind if I get this patchd committed? -- ___ Python tracker <http://bugs.python.org/issue18281> ___ ___ Python-bug

[issue19201] lzma and 'x' mode open

2013-10-09 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman stage: -> patch review ___ Python tracker <http://bugs.python.org/issue19201> ___ ___ Python-bugs-list mai

[issue18281] tarfile defines stat constants

2013-10-12 Thread Ethan Furman
Ethan Furman added the comment: Sounds like we have a consensus. If no objections I'll commit in four or five days (in time for the last alpha). -- ___ Python tracker <http://bugs.python.org/is

[issue18281] tarfile defines stat constants

2013-10-12 Thread Ethan Furman
Ethan Furman added the comment: Cool, thanks! I didn't want to step on any toes. :) -- ___ Python tracker <http://bugs.python.org/issue18281> ___ ___ Pytho

[issue19239] add inspect functions to

2013-10-12 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: ethan.furman priority: normal severity: normal status: open title: add inspect functions to ___ Python tracker <http://bugs.python.org/issue19

[issue19239] add inspect functions to retrieve attributes from both old dir() and overridden dir()

2013-10-12 Thread Ethan Furman
New submission from Ethan Furman: Currently we have - inspect.getmembers - inspect.classify_class_attrs But they only return what dir() returns. It is proposed that we add - inspect.get_all_members - inspect.classify_all_class_attrs which will look at all the attributes returned by

[issue16938] pydoc confused by __dir__

2013-10-13 Thread Ethan Furman
Ethan Furman added the comment: 'None' is not an appropriate response to the "Where does this attribute come from" question. For one, it's wrong. For two, it breaks help. The current patch fixes that particular problem (as a last resort it walks the mro lookin

[issue16938] pydoc confused by __dir__

2013-10-13 Thread Ethan Furman
Ethan Furman added the comment: Nick Couphlan added the comment: > > No, __class__ on a descriptor has *NOTHING* to do with how it was > looked up. It's the class of the *result*. Which is why in most cases it's discarded as the home class. (I could easily be saying this wr

[issue19239] add inspect functions to retrieve attributes from both old dir() and overridden dir()

2013-10-13 Thread Ethan Furman
Ethan Furman added the comment: It would certainly be nice. We could do a dir() on the metaclass, discarding anything either not in dir(type) or not dundered, or both. -- ___ Python tracker <http://bugs.python.org/issue19

[issue16938] pydoc confused by __dir__

2013-10-13 Thread Ethan Furman
Ethan Furman added the comment: That portion of classify_class_attrs now reads: else: homecls = getattr(get_obj, "__objclass__", None) if homecls not in possible_bases: # if the resulting object does not live somewhere in the # mro, drop

[issue19252] Enum.py : Enum.__new__() : Test Coverage

2013-10-13 Thread Ethan Furman
Ethan Furman added the comment: I'm not sure what you are talking about. Here's the code: try: if value in cls._value2member_map_: return cls._value2member_map_[value] except TypeError: # not there, now do long search -- O(n) behavior for

[issue19249] Enumeration.__eq__

2013-10-13 Thread Ethan Furman
Ethan Furman added the comment: Here's the current __eq__ method: def __eq__(self, other): if type(other) is self.__class__: return self is other return NotImplemented It is, in fact, using identity and not value equality. I'm thinking we should eit

[issue19252] Enum.py : Enum.__new__() : Test Coverage

2013-10-14 Thread Ethan Furman
Ethan Furman added the comment: CliffM added the comment: > > Sorry -- I could have been clearer : > > The conditional: > > if member.value == value: > > Is redundant as the tests stand. If you comment it out -- everything works. > So therefore we are missing a tes

[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors

2013-10-14 Thread Ethan Furman
Ethan Furman added the comment: Updated and renamed the DynamicClassAttribute tests, and discovered that classify_class_attrs is not handling instance portion correctly. class Meta(type): def __getattr__(self, name): if name == 'ham': re

[issue16938] pydoc confused by __dir__

2013-10-14 Thread Ethan Furman
Ethan Furman added the comment: Discovered a problem with one of the tests, moved back to issue19030. The __class__/__objclass__ is gone, the code is simpler. When issue19030 is committed I think we can make a doc change to include __objclass__ somewhere and close this one. -- stage

[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors

2013-10-14 Thread Ethan Furman
Ethan Furman added the comment: Updated tests now passing. Will commit Thursday, or Friday at the latest. -- stage: -> patch review Added file: http://bugs.python.org/file32123/issue19030.stoneleaf.05.patch ___ Python tracker &l

[issue19252] Enum.py : Enum.__new__() : Test Coverage

2013-10-14 Thread Ethan Furman
Ethan Furman added the comment: Well, I would say it's half a coverage issue, half a guard against accidental deletion of the if test. :) -- ___ Python tracker <http://bugs.python.org/is

[issue10757] zipfile.write, arcname should be allowed to be a byte string

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

[issue10972] zipfile: add "unicode" option to the force the filename encoding to UTF-8

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

[issue10614] ZipFile: add a filename_encoding argument

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

[issue16310] zipfile: allow surrogates in filenames

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

[issue19263] enum.py : Enum.__new__(). __objclass__

2013-10-14 Thread Ethan Furman
Ethan Furman added the comment: It was originally put in to help inspect.classify_class_attrs, but recent subsequent changes (not yet committed, issue19030), make it unnecessary. Whether or not it stays depends on the changes to inspect being committed. -- assignee: -> ethan.fur

[issue16938] pydoc confused by __dir__

2013-10-14 Thread Ethan Furman
Ethan Furman added the comment: Ronald, if you get a chance could you try your descriptor, without the __objclass__ work around, with the latest patch in #19030? -- ___ Python tracker <http://bugs.python.org/issue16

[issue19268] Local variable created with reflection cannot be referenced with identifier

2013-10-15 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman resolution: invalid -> stage: committed/rejected -> status: closed -> open ___ Python tracker <http://bugs.python.or

[issue19268] Local variable created with reflection cannot be referenced with identifier

2013-10-15 Thread Ethan Furman
Ethan Furman added the comment: Oops! Issue update error, I was just adding myself to nosy as it looked like it was still open. Re-closing. -- resolution: -> invalid stage: -> committed/rejected status: open -> closed ___ Python track

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-16 Thread Ethan Furman
Ethan Furman added the comment: According to the docs[1]: 12.1.4. What can be pickled and unpickled? The following types can be pickled: - None, True, and False - integers, floating point numbers, complex numbers - strings, bytes, bytearrays - tuples, lists, sets, and

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-16 Thread Ethan Furman
Ethan Furman added the comment: Yeah, that one line should say, "named functions defined at the top level of a module". The following three paragraphs do, however, mention "named" several times. Sounds like a doc issue. -- __

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-16 Thread Ethan Furman
Ethan Furman added the comment: The problem with a randam unique name is making sure you get the same random unique name across different runs, different pythons, and different orders of execution. -- ___ Python tracker <http://bugs.python.

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-16 Thread Ethan Furman
Ethan Furman added the comment: >From the pickle docs: = Note that functions (built-in and user-defined) are pickled by “fully qualified” name reference, not by value. This means that only the function name is pickled, al

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-16 Thread Ethan Furman
Ethan Furman added the comment: Jesús Cea Avión added the comment: > > If at your "top level" (module) you do: > > """ > a = lambda x: 2*x > """ > > You don't have an anonymous function, but a function called "a".

[issue1615] PyObject_GenericGetAttr suppresses AttributeErrors in descriptors

2013-10-16 Thread Ethan Furman
Ethan Furman added the comment: Well, attached patch doesn't segfault in debug mode, but the errors aren't any better; in fact, I'd say their worse. Here's the current output from my test script: === getter failed

[issue1615] PyObject_GenericGetAttr suppresses AttributeErrors in descriptors

2013-10-16 Thread Ethan Furman
Ethan Furman added the comment: If anyone with more experience wants ownership, feel free to take it from me. ;) Otherwise I'll do my best to get this figured out in time for the beta. -- assignee: -> ethan.furman stage: ->

[issue8297] AttributeError message text should include module name

2013-10-16 Thread Ethan Furman
Changes by Ethan Furman : -- assignee: -> ethan.furman versions: +Python 3.4 -Python 2.7, Python 3.2 ___ Python tracker <http://bugs.python.org/iss

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-17 Thread Ethan Furman
Changes by Ethan Furman : -- keywords: +patch Added file: http://bugs.python.org/file32155/issue19272.stoneleaf.01.patch ___ Python tracker <http://bugs.python.org/issue19

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

2013-10-17 Thread Ethan Furman
Ethan Furman added the comment: Where do we stand with this issue? -- ___ Python tracker <http://bugs.python.org/issue17576> ___ ___ Python-bugs-list mailin

[issue16938] pydoc confused by __dir__

2013-10-18 Thread Ethan Furman
Ethan Furman added the comment: This has been fixed in #19030: every good object will have a home class; non-good objects (the result of buggy __dir__, __getattribute__, or __getattr__ methods) will not be returned and so cannot confuse pydoc. -- resolution: -> fixed st

[issue19281] add __objclass__ to the docs

2013-10-18 Thread Ethan Furman
New submission from Ethan Furman: Currently __objclass__ is only documented in a ten-year old PEP. -- messages: 200190 nosy: eric.araujo, ethan.furman, ezio.melotti, georg.brandl priority: normal severity: normal status: open title: add __objclass__ to the docs

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-18 Thread Ethan Furman
Ethan Furman added the comment: Added some clarification to the docs to make it clearer that lambda functions cannot be pickled. Facundo [1], if you want to pursue being able to pickle lambda functions please open an enhancement issue. Some of the questions that come to mind: 1) for a

[issue19249] Enumeration.__eq__

2013-10-19 Thread Ethan Furman
Ethan Furman added the comment: Given the rarity of singletons, I don't think changing pickle in that way is appropriate. Besides, pickle protocol 2 and above don't have the problem. -- ___ Python tracker <http://bugs.python.o

[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors

2013-10-21 Thread Ethan Furman
Ethan Furman added the comment: Charles-François Natali added the comment: > > Ethan, you just broke all the buildbots: you're now officialy a core > developer! ;-) I was actually hoping to put off this particular honor for a

[issue19030] inspect.getmembers and inspect.classify_class_attrs mishandle descriptors

2013-10-21 Thread Ethan Furman
Ethan Furman added the comment: Thanks, Charles-François! The problem occurred when I tried to push the commit and was told there was trailing white-space. Naturally I then ran the de-whitespacing tool which of course removed the whitespace from those lines where you added the \x20s back on

[issue19331] Revise PEP 8 recommendation for class names

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

[issue19330] Use public classes for contextlib.suppress and redirect_stdout

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

[issue12029] Catching virtual subclasses in except clauses

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

<    5   6   7   8   9   10   11   12   13   14   >