◐ Shell
reader mode source ↗
Skip to content

bpo-32492: Tweak _collections._tuplegetter.#11367

Merged
serhiy-storchaka merged 8 commits into
python:masterfrom
serhiy-storchaka:tuplegetter2
Dec 31, 2018
Merged

bpo-32492: Tweak _collections._tuplegetter.#11367
serhiy-storchaka merged 8 commits into
python:masterfrom
serhiy-storchaka:tuplegetter2

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Dec 30, 2018

Copy link
Copy Markdown
Member
  • Remove the docstrings cache.
  • Improve tests.
  • Unify names of tp_descr_get and tp_descr_set functions.

https://bugs.python.org/issue32492

* Remove the docstrings cache.
* Improve tests.
* Unify names of tp_descr_get and tp_descr_set functions.
@rhettinger

Copy link
Copy Markdown
Contributor

Consider adding another test for inspect.isdatadescriptor(Point.x)

@rhettinger

Copy link
Copy Markdown
Contributor

If caching is taken out, then docstring interning should be added back.

Python 3.8.0a0 (heads/pr_11367:906c21fb8b, Dec 30 2018, 14:49:20)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import namedtuple
>>> P = namedtuple('P', ['m', 'n'])
>>> Q = namedtuple('Q', ['o', 'p'])
>>> P.m.__doc__ is Q.o.__doc__
False
>>> P.m.__doc__ == Q.o.__doc__
True

@rhettinger

Copy link
Copy Markdown
Contributor

Also, the test for the exact help() string seems fragile (it depends on the exact spacing and formatting of the help() output). Instead, just check for the presence of the docstring or check that it is data descriptor and leave it at that.

@serhiy-storchaka serhiy-storchaka merged commit 052b2df into python:master Dec 31, 2018
@serhiy-storchaka serhiy-storchaka deleted the tuplegetter2 branch December 31, 2018 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants