Skip to content

Use argument and return type line numbers for error messages - #3395

Merged
gvanrossum merged 1 commit into
python:masterfrom
patrickw276:decorated-function-lineno
May 22, 2017
Merged

gvanrossum merged 1 commit into
python:masterfrom
patrickw276:decorated-function-lineno

Conversation

@patrickw276

Copy link
Copy Markdown
Contributor

Fixes #3177

@gnprice gnprice self-assigned this May 22, 2017
@gvanrossum

Copy link
Copy Markdown
Member

I'll review.

def dec(f): pass

@dec
def test(a: str) -> (str,): # E: Invalid tuple literal type

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add a test where the ) -> ... part is on a separate line?

def dec(f): pass

@dec
def some_method(self: badtype): pass # E: Name 'badtype' is not defined

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

imilar with multiple arguments across multiple lines.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated PR with additional tests.

@gnprice gnprice removed their assignment May 22, 2017
@gvanrossum
gvanrossum merged commit 3602a95 into python:master May 22, 2017
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.

3 participants