Skip to content

py3: traceback.pyi: added format_stack #125

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 1 commit into from
Apr 11, 2016
Merged

py3: traceback.pyi: added format_stack #125

merged 1 commit into from
Apr 11, 2016

Conversation

PAStheLoD
Copy link
Contributor

I considered adding other missing functions, but some are 3.4+ or 3.5+ only. Is there a better way than copy-pasting the whole file to the relevant 3.4/ and 3.5/ directories?

@matthiaskramm
Copy link
Contributor

You can use https://www.python.org/dev/peps/pep-0484/#version-and-platform-checking

So it's legal to write something like

if sys.version_info[0] >= (3, 4):
    def foo(x: Bar) -> Baz: ...

Note that mypy doesn't fully support this yet (the current version will assume that foo() is always there, also you can't put two different signatures into the if and the else).

So it's like adding a comment # Python 3.4 only, but it'll also get semantical meaning at some point.

@gvanrossum
Copy link
Member

Could you also update the 2.7 version? Agreed with Matthias on how to add version-specific features.

@gvanrossum
Copy link
Member

Merging this now, but please see previous comments -- ping?

@gvanrossum gvanrossum merged commit 6830648 into python:master Apr 11, 2016
jukebox pushed a commit to jukebox/typeshed that referenced this pull request Apr 11, 2016
@PAStheLoD
Copy link
Contributor Author

Hello!

Sorry for the delay; I planned to get this done on the (last) weekend, but things got in the way (as they have a tendency to do).

Shall I submit a new PR or update this?

@gvanrossum
Copy link
Member

Please update this one -- you can just add more commits. I'll squash them when I merge.

momandine pushed a commit to momandine/typeshed that referenced this pull request Jul 5, 2016
hswong3i pushed a commit to alvistack/python-typeshed that referenced this pull request May 25, 2025
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