Skip to content

Identify typing.NewType wrappers and construct annotation references #64

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

Merged
merged 3 commits into from
Dec 23, 2018

Conversation

gwax
Copy link
Contributor

@gwax gwax commented Nov 21, 2018

Resolves #41 producing output of the form NewType(NewName, OldType) with appropriate references.

@rmorshea
Copy link

rmorshea commented Dec 19, 2018

@gwax @agronholm any idea whether this will get merged in? This would be super useful to me.

@agronholm
Copy link
Collaborator

I'll try to take a look at this this weekend.

@agronholm agronholm merged commit 8d3867b into tox-dev:master Dec 23, 2018
@agronholm
Copy link
Collaborator

Thanks!

@agronholm
Copy link
Collaborator

@gwax I've been rechecking the code and I cannot figure out why you chose to format the name of the NewType as :py:data:~TypeName. Shouldn't it contain the module name as well, like :py:data:~module.name.TypeName? I'm also wondering if the formatting scheme is even in the right direction. Maybe just :py:data:~module.name.TypeName should be used, without involving typing.NewType?

@agronholm
Copy link
Collaborator

Ok, the module name containing the new type is not recorded anywhere so this is the best we can do. Sorry for the noise :)

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.

Types created with NewType are rendered poorly.
3 participants