Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-40257: Improve help for the typing module #19546

Merged
merged 4 commits into from Apr 18, 2020

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Apr 15, 2020

  • Show docstring for special forms.
  • Show docstring for special generic aliases.
  • Show documentation for __origin__ for generic aliases.

https://bugs.python.org/issue40257

* Show docstring for special forms.
* Show docstring for special generic aliases.
* Show documentation for __origin__ for generic aliases.
Copy link
Member

@gvanrossum gvanrossum left a comment

Looks good to me. But let's see what @ilevkivskyi thinks.

@gvanrossum
Copy link
Member

@gvanrossum gvanrossum commented Apr 16, 2020

Playing with this, I noticed that pydoc.doc(Any) prints output that doesn't end in a \n. Is that expected? (I really don't know anything about pydoc.)

Copy link
Contributor

@ilevkivskyi ilevkivskyi left a comment

Thanks! Looks good, I have just one optional question.

Lib/typing.py Outdated

@__doc__.setter
def __doc__(self, value):
self._doc = value
Copy link
Contributor

@ilevkivskyi ilevkivskyi Apr 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this to be settable? If possible I would keep it read-only, but it is not very important.

Copy link
Member

@gvanrossum gvanrossum left a comment

Thanks!

@serhiy-storchaka serhiy-storchaka merged commit 7e64414 into python:master Apr 18, 2020
9 checks passed
@serhiy-storchaka serhiy-storchaka deleted the typing-pydoc branch Apr 18, 2020
CuriousLearner added a commit to CuriousLearner/cpython that referenced this issue May 29, 2020
* master: (1985 commits)
  bpo-40179: Fix translation of #elif in Argument Clinic (pythonGH-19364)
  bpo-35967: Skip test with `uname -p` on Android (pythonGH-19577)
  bpo-40257: Improve help for the typing module (pythonGH-19546)
  Fix two typos in multiprocessing (pythonGH-19571)
  bpo-40286: Use random.randbytes() in tests (pythonGH-19575)
  bpo-40286: Makes simpler the relation between randbytes() and getrandbits() (pythonGH-19574)
  bpo-39894: Route calls from pathlib.Path.samefile() to os.stat() via the path accessor (pythonGH-18836)
  bpo-39897: Remove needless `Path(self.parent)` call, which makes `is_mount()` misbehave in `Path` subclasses. (pythonGH-18839)
  bpo-40282: Allow random.getrandbits(0) (pythonGH-19539)
  bpo-40302: UTF-32 encoder SWAB4() macro use a|b rather than a+b (pythonGH-19572)
  bpo-40302: Replace PY_INT64_T with int64_t (pythonGH-19573)
  bpo-40286: Add randbytes() method to random.Random (pythonGH-19527)
  bpo-39901: Move `pathlib.Path.owner()` and `group()` implementations into the path accessor. (pythonGH-18844)
  bpo-40300: Allow empty logging.Formatter.default_msec_format. (pythonGH-19551)
  bpo-40302: Add pycore_byteswap.h header file (pythonGH-19552)
  bpo-40287: Fix SpooledTemporaryFile.seek() return value (pythonGH-19540)
  Minor modernization and readability improvement to the tokenizer example (pythonGH-19558)
  bpo-40294: Fix _asyncio when module is loaded/unloaded multiple times (pythonGH-19542)
  Fix parameter names in assertIn() docs (pythonGH-18829)
  bpo-39793: use the same domain on make_msgid tests (python#18698)
  ...
vegerot pushed a commit to vegerot/cpython that referenced this issue Jun 10, 2020
* Show docstring for special forms.
* Show docstring for special generic aliases.
* Show documentation for __origin__ for generic aliases.
vegerot pushed a commit to vegerot/cpython that referenced this issue Jun 10, 2020
* Show docstring for special forms.
* Show docstring for special generic aliases.
* Show documentation for __origin__ for generic aliases.
gmelikov pushed a commit to gmelikov/cpython that referenced this issue Aug 22, 2020
* Show docstring for special forms.
* Show docstring for special generic aliases.
* Show documentation for __origin__ for generic aliases.
chrisburr pushed a commit to chrisburr/cpython that referenced this issue Dec 9, 2020
* Show docstring for special forms.
* Show docstring for special generic aliases.
* Show documentation for __origin__ for generic aliases.
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.

None yet

5 participants