Nick Coghlan added the comment:
+1, works for me :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
___
Python-bugs-list mailing list
Changes by Barry A. Warsaw ba...@python.org:
--
nosy: -python-dev
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
Barry A. Warsaw added the comment:
Thanks Ethan, your latest patch is wonderful. Applied!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
Roundup Robot added the comment:
New changeset 1a40d4eaa00b by Barry Warsaw in branch 'default':
Ethan Furman's latest patch for Issue 19331.
http://hg.python.org/peps/rev/1a40d4eaa00b
--
nosy: +python-dev
___
Python tracker rep...@bugs.python.org
Ethan Furman added the comment:
How's this? I liked Barry's simpler Overriding Principle combine with Nick's
simpler Class Names.
--
Added file: http://bugs.python.org/file32444/issue19331.stoneleaf.03.patch
___
Python tracker
Antoine Pitrou added the comment:
In cases where inheritance is not encouraged and it is judged to improve
readability at the point of use, the naming convention for callables
(lower_case_with_underscores) may be used instead. This is an indication
that the type is intended primarily for use
Nick Coghlan added the comment:
collections.defaultdict, collections.deque, array.array and many of the
builtins suggest the rule isn't that simple (although other examples like
Decimal, Fraction, OrderedDict, Counter and ChainMap suggest my guideline is
also wrong).
The main thing I want is
Antoine Pitrou added the comment:
collections.defaultdict, collections.deque, array.array and many of
the builtins suggest the rule isn't that simple (although other
examples like Decimal, Fraction, OrderedDict, Counter and ChainMap
suggest my guideline is also wrong).
AFAIK, they are
Nick Coghlan added the comment:
Documenting it as a callable is a pretty strong hint that it shouldn't be
subclassed, but I agree my wording above is wrong. Next attempt (leaving out
the mention of leading underscores, since that is covered elsewhere):
=
Class Names
Paul Moore added the comment:
I'm in favour of keeping it simple - use your common sense should be a
general guideline here (even though I know people's tastes differ, and that can
be a source of endless debate :-))
--
___
Python tracker
Barry A. Warsaw added the comment:
I always prefer to keep PEP 8 guidelines as succinct as possible. I've looked
over Ethan's patch and the other changes suggested in comments and come up with
what I think is a simple patch to improve the guidelines. I don't think we
need to go into a lot
Antoine Pitrou added the comment:
I always prefer to keep PEP 8 guidelines as succinct as possible.
I've looked over Ethan's patch and the other changes suggested in
comments and come up with what I think is a simple patch to improve
the guidelines.
Have you read what I wrote? Inheritance
Antoine Pitrou added the comment:
-1 on Barry's wording and +1 on Nick's wording in msg201119.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
Nick Coghlan added the comment:
Barry, Antoine convinced me that my wording from earlier was both inaccurate
and overly complicated. I'm happy with the simplified version just above Paul's
last comment, though, so combining that with the earlier part of your patch
looks promising to me.
Changes by Ethan Furman et...@stoneleaf.us:
Added file: http://bugs.python.org/file32321/issue19331.stoneleaf.02.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
Ethan Furman added the comment:
Attached patch combines Paul's, Antoine's, and Nick's suggestions/observations.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
Changes by Ethan Furman et...@stoneleaf.us:
--
keywords: +patch
Added file: http://bugs.python.org/file32298/issue19331.stoneleaf.01.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
Changes by Ethan Furman et...@stoneleaf.us:
--
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
___
Python-bugs-list
Nick Coghlan added the comment:
Hmm, review link doesn't appear to be available, so just commenting here.
For the overriding principle part, you can't switch from a class to a factory
function (as that's a backwards incompatible change due to breaking subclassing
and isinstance and
Paul Moore added the comment:
+1 on switching the wording in the overriding principle section to say factory
function to class. Although the fact that I made that mistake reflects my
point that if I'm thinking of class-wrapper as an internal change then I'm
not anticipating or supporting
New submission from Barry A. Warsaw:
PEP 8 says:
Class Names
Almost without exception, class names use the CapWords convention. Classes for
internal use have a leading underscore in addition.
yet there are some notable exceptions in practice, such as classes designed to
be context managers
Changes by Barry A. Warsaw ba...@python.org:
--
assignee: - barry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
___
Python-bugs-list
Paul Moore added the comment:
How about simply adding a further sentence, something like:
Where a class is being used conceptually as a callable (for example, context
managers), the naming convention for callables (lower_case_with_underscores)
should be followed.
Maybe also add a section at
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
___
Python-bugs-list
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
___
Antoine Pitrou added the comment:
s/should be followed/may be followed/
As an other point of reference, for a long time the synchronization classes in
the threading module were actually mediated by function wrappers, e.g.:
def Lock(*args, **kwargs):
return _Lock(*args, **kwargs)
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +ncoghlan
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
___
Python-bugs-list mailing
Nick Coghlan added the comment:
Lots of builtins, collections and itertools use lowercase names as well, as do
some older stdlib types (array, mmap, socket).
The only clear dividing lines I can really discern are that ABCs *must* start
with a capital, as should classes paired with a separate
Nick Coghlan added the comment:
That said, I quite like Paul's suggestions.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
___
___
Barry A. Warsaw added the comment:
On Oct 21, 2013, at 08:41 PM, Nick Coghlan wrote:
That said, I quite like Paul's suggestions.
As do I.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19331
30 matches
Mail list logo