Re: [Python-ideas] New Python syntax for continuing definitions for existing classes

2016-09-14 Thread nate lust
All, I must say It is still exciting to be at a point of getting an official declaration on a topic from Guido. We thank you for your time and feedback. It has been a good experience and hope to be able to contribute in some other way in the future. Nate and Pim On Wed, Sep 14, 2016 at 12:30 PM Gu

Re: [Python-ideas] New Python syntax for continuing definitions for existing classes

2016-09-14 Thread Guido van Rossum
There shall be no standard syntax for monkey-patching. Decorators are fine. I recommend putting a monkey-patching package on PyPI and see if people use it. Maybe eventually it can be in the stdlib but I really don't want to encourage this idiom (even if it's sometimes useful). You should always c

Re: [Python-ideas] New Python syntax for continuing definitions for existing classes

2016-09-14 Thread Pim Schellart
Dear All, Thank you for your feedback! While we think the decorator solution is not as writable, readable or discoverable as our proposed syntax we understand the desire to discourage a potential paradigm switch to `open classes’. We recognise that in many cases refactoring the code to eliminate

Re: [Python-ideas] Naming convention for Enums

2016-09-14 Thread Guido van Rossum
I recommend naming all enums UPPER_CASE. They're constants (within a namespace) and that's the rule for constants. It's helpful for the reader of the code to realize what they are when passed around -- they have a similar status to literal constants, you know they stand for a unique value and not f

Re: [Python-ideas] New Python syntax for continuing definitions for existing classes

2016-09-14 Thread Nick Coghlan
On 14 September 2016 at 05:46, Ralph Broenink wrote: > Hi all, > > On Tue, 13 Sep 2016 at 18:30 Chris Angelico wrote: >> >> Did you know that you can actually abuse decorators to do this with >> existing syntax? Check out this collection of evil uses of decorators: >> >> https://github.com/Rosuav

Re: [Python-ideas] Naming convention for Enums

2016-09-14 Thread Paul Moore
On 14 September 2016 at 12:51, Chris Angelico wrote: > Perhaps the advice needs to be along the lines of: Decide what the > purpose of the enum is, and follow a naming convention accordingly. > Uppercase if you're basically making constants; lowercase if you're > not; etcetera. Agreed - it's not

Re: [Python-ideas] Naming convention for Enums

2016-09-14 Thread Chris Angelico
On Wed, Sep 14, 2016 at 9:20 PM, Bar Harel wrote: > Enums in Python are a unique creature - it's a class, the members aren't > injected into module level, it can have methods, but it's attributes are > somewhat consts (although they can be modified via __new__). > > Although I'm in favor of lower-

[Python-ideas] Naming convention for Enums

2016-09-14 Thread Bar Harel
Hey guys, This is something that has been discussed before several times, whether in Python mailing list and whether in stackoverflow, each providing different answers. I believe that we should add a naming convention in pep8 to solve this issue. Enums in Python are a unique creature - it's a cl