Skip to content

typing: fix/adjust _code.source.getfslineno#6527

Merged
blueyed merged 1 commit intopytest-dev:masterfrom
blueyed:typing-getfslineno
Jan 23, 2020
Merged

typing: fix/adjust _code.source.getfslineno#6527
blueyed merged 1 commit intopytest-dev:masterfrom
blueyed:typing-getfslineno

Conversation

@blueyed
Copy link
Contributor

@blueyed blueyed commented Jan 21, 2020

No description provided.

@bluetech
Copy link
Member

👍 on the Optional. Curious that it wasn't caught.

Since the caller already needs to handle None, does it make sense to exchange the return '', 1 with return None, -1? Then the type will be simpler. But I didn't check the callers.

@blueyed
Copy link
Contributor Author

blueyed commented Jan 21, 2020

Since the caller already needs to handle None, does it make sense to exchange the return '', 1 with return None, -1? Then the type will be simpler. But I didn't check the callers.

I'm reluctant to messing with code here, but just want to type what is used.

@blueyed
Copy link
Contributor Author

blueyed commented Jan 21, 2020

I think None might only happen in case inspect would return an empty string (a theoretical case I guess).
Also curious why it wasn't caught by mypy, but have not checked.

@blueyed blueyed merged commit 8521503 into pytest-dev:master Jan 23, 2020
@blueyed blueyed deleted the typing-getfslineno branch January 23, 2020 12:17
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