Skip to content

ref: Type hints for init()#401

Merged
untitaker merged 7 commits into
masterfrom
ref/type-hints-4-init
Jun 27, 2019
Merged

ref: Type hints for init()#401
untitaker merged 7 commits into
masterfrom
ref/type-hints-4-init

Conversation

@untitaker
Copy link
Copy Markdown
Member

@untitaker untitaker commented Jun 25, 2019

Fix #272

@untitaker untitaker requested review from bruno-garcia and mitsuhiko and removed request for mitsuhiko June 26, 2019 13:33
@untitaker untitaker changed the title [wip] ref: Type hints for init() ref: Type hints for init() Jun 26, 2019
Comment thread sentry_sdk/consts.py
}


# This type exists to trick mypy and PyCharm into thinking `init` and `Client`
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.

trick huh?

@untitaker untitaker merged commit 5726d1b into master Jun 27, 2019
@untitaker untitaker deleted the ref/type-hints-4-init branch June 27, 2019 16:12
@untitaker
Copy link
Copy Markdown
Member Author

@bluetech Since you're using mypy in real code together with the SDK, could you test if this still works with this PR? If yes I'll release it.

@bluetech
Copy link
Copy Markdown
Contributor

I installed from master, and verified that sentry.init() now type-checks its arguments - nice! There weren't any new errors from mypy. Note I didn't get a chance to actually execute the code (sentry init is skipped locally).

@untitaker
Copy link
Copy Markdown
Member Author

That seems fine, the runtime code didn't change. Will release now, thanks!

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.

Python 3 type hints are broken/unusuable

3 participants