Skip to content

Conversation

msullivan
Copy link
Collaborator

This bypasses pyannotate's parsing and processing of annotations
and allows us to just specify them directly. This is useful because
pyannotate doesn't support Callable.

This bypasses pyannotate's parsing and processing of annotations
and allows us to just specify them directly. This is useful because
pyannotate doesn't support Callable.
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good, I just have one question.

@@ -247,7 +253,11 @@ def get_args(self, is_method: bool,
if default:
all_arg_types.append(default)

if all_arg_types:
if len(all_arg_types) == 1 and isinstance(get_proper_type(all_arg_types[0]), NoneType):
Copy link
Member

Choose a reason for hiding this comment

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

Generally this is good idea, this is consistent to what stubgen does. But why do we need to check that length is 1? This is not a set, how do we know all the types are unique there?

@msullivan msullivan merged commit 211d182 into master Sep 3, 2019
@msullivan msullivan deleted the suggest-signature branch September 3, 2019 21:52
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