Sitelet https://github.com/python/typing_extensions/pull/174
Skip to content

Improve the repr() of _marker - #174

Merged
JelleZijlstra merged 2 commits into
python:mainfrom
AlexWaygood:better-sentinel
May 22, 2023
Merged

JelleZijlstra merged 2 commits into
python:mainfrom
AlexWaygood:better-sentinel

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented May 22, 2023 •

Copy link
Copy Markdown
Member

This makes the output from help(typing_extensions.TypeVar) much more readable.

Before:

>>> help(typing_extensions.TypeVar)
Help on class TypeVar in module typing:

class TypeVar(builtins.object)
 |  TypeVar(name, *constraints, bound=None, covariant=False, contravariant=False, default=<object object at 0x0000028D453A8760>, infer_variance=False)

After:

>>> help(typing_extensions.TypeVar)
Help on class TypeVar in module typing:

class TypeVar(builtins.object)
 |  TypeVar(name, *constraints, bound=None, covariant=False, contravariant=False, default=<sentinel>, infer_variance=False)

@AlexWaygood

Copy link
Copy Markdown
Member Author

The "help on class TypeVar in module typing" thing, when it's actually giving you help on a class from typing_extensions, is a bit weird. But that's a separate issue...

Comment thread src/typing_extensions.py
@JelleZijlstra
JelleZijlstra merged commit 88be907 into python:main May 22, 2023
@AlexWaygood
AlexWaygood deleted the better-sentinel branch May 22, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants