Raymond Hettinger added the comment:
https://www.python.org/dev/peps/pep-0008/#class-names -- "Class names should
normally use the CapWords convention."
Examples:
---------
crypt.py
6:from collections import namedtuple as _namedtuple
13:class _Method(_namedtuple('_Method', 'name ident salt_chars total_size')):
difflib.py
34:from collections import namedtuple as _namedtuple
36:Match = _namedtuple('Match', 'a b size')
dis.py
163:_Instruction = collections.namedtuple("_Instruction",
280: Generates a sequence of Instruction namedtuples giving the details of
each
doctest.py
107:from collections import namedtuple
109:TestResults = namedtuple('TestResults', 'failed attempted')
functools.py
21:from collections import namedtuple
345:_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize",
"currsize"])
inspect.py
51:from collections import namedtuple, OrderedDict
323:Attribute = namedtuple('Attribute', 'name kind defining_class object')
968:Arguments = namedtuple('Arguments', 'args, varargs, varkw')
1008:ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults')
1032:FullArgSpec = namedtuple('FullArgSpec',
1124:ArgInfo = namedtuple('ArgInfo', 'args varargs keywords locals')
1317:ClosureVars = namedtuple('ClosureVars', 'nonlocals globals builtins
unbound')
1372:Traceback = namedtuple('Traceback', 'filename lineno function code_context
index')
1412:FrameInfo = namedtuple('FrameInfo', ('frame',) + Traceback._fields)
nntplib.py
159:GroupInfo = collections.namedtuple('GroupInfo',
162:ArticleInfo = collections.namedtuple('ArticleInfo',
No doubt, there are exceptions to the rule in the standard library which is
less consistent than we might like: "stat_result". That said, stat_result is
a structseq and many C type names are old or violate the rules (list vs List,
etc). New named tuples should follow PEP 8 can use CapWords convention unless
there is a strong reason not to in a particular case.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26860>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com