Skip to content

Conversation

@east825
Copy link
Contributor

At the moment this special marker annotation described in
PEP 613 exists only in typing_extensions module
(see python/typing#732).

At the moment this special marker annotation described in PEP 613 exists only in typing_extensions module (see python/typing#732).
@east825
Copy link
ContributorAuthor

BTW, what's the difference between declarations such as

Any = object() 
TypedDict: object 

(in typing.pyi)

and

TypedDict: object = ... 

(in typing_extensions.pyi)

These are considered equivalent, aren't they? Which one is preferred then?

@srittau
Copy link
Collaborator

Foo: object is the preferred form. The = ... is redundant. Any = object() doesn't make much sense in stubs. The reason that type checkers don't complain is that typing.pyi is usually special-cased by them.

@east825
Copy link
ContributorAuthor

Ok, thanks! I'll drop "= ..." part in my PR then.

@srittausrittau merged commit 30bbf02 into python:masterJun 19, 2020
vishalkuo pushed a commit to vishalkuo/typeshed that referenced this pull request Jun 26, 2020
@hauntsaninjahauntsaninja mentioned this pull request Jul 22, 2020
@east825east825 deleted the PEP-613_typing_extensions.TypeAlias branch October 7, 2020 19:54
Sign up for freeto 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

@east825@srittau