Repository navigation
Conversation
…1843) - Name the generated namedtuple bases of VersionInfo, ModuleDescriptor, NTPTimestamp and PMIPv6Timestamp with a leading underscore, so a page's `Bases:` line no longer links the class to itself. repr, str, copies, `_make` and the pickle bytes at every protocol are unchanged. - Add a regression test that each direct namedtuple base is named apart from its class, and a guard that repr, copies and pickles still name the subclass. Closes #1843
|
Verdict: GOOD TO GO at
The bases now render as unlinked |
|
For those named tuples, should they better be an Info class? VersionInfo stays named tuple as it’s matching the std-lib's, and ModuleDescriptor makes sense as well, but what about the others? Also, I don't think they'd need their specific name for the base classes? It's fine to be linked back to themselves as the base classes are actually just a placeholder. |
|
Thanks. My reading of your points:
Before recommending, I'm checking what converting the two timestamps would break: tuple indexing and unpacking, comparison, hashing, pickling, and where they are documented and constructed. I'll reply here with the measured answer. I'm also checking which other named tuples in the package the same question applies to. Until then this PR is on hold, labelled |
|
Measured on
Recommendation:
Shall I go ahead with 1 and 2? |
|
take your reommendations |
|
Recorded: you accepted both recommendations.
|
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the change. Narrow runs only, listed below.Added a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible: N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseNTPTimestamp and PMIPv6Timestamp with a leading underscore, so a page's
Bases:line no longer links the class to itself. repr, str, copies,_makeand the pickle bytes at every protocol are unchanged.from its class, and a guard that repr, copies and pickles still name the
subclass.
Closes #1843