Message264506
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. |
|
Date |
User |
Action |
Args |
2016-04-29 16:09:11 | rhettinger | set | recipients:
+ rhettinger, loewis, ethan.furman, serhiy.storchaka, palaviv |
2016-04-29 16:09:11 | rhettinger | set | messageid: <1461946151.36.0.680964037768.issue26860@psf.upfronthosting.co.za> |
2016-04-29 16:09:11 | rhettinger | link | issue26860 messages |
2016-04-29 16:09:10 | rhettinger | create | |
|