Skip to content

Improve the repr() of _marker#174

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

Improve the repr() of _marker#174
JelleZijlstra merged 2 commits intopython:mainfrom
AlexWaygood:better-sentinel

Conversation

@AlexWaygood
Copy link
Copy Markdown
Member

@AlexWaygood AlexWaygood commented May 22, 2023

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...

@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