Skip to content

refactor type hinting - #51

Merged
tobywf merged 4 commits into
masterfrom
cleaner_type_hints
Nov 21, 2019
Merged

tobywf merged 4 commits into
masterfrom
cleaner_type_hints

Conversation

@jaymccon

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

resubmission of #44

Main aim of this pr is to simplify the representation of type hints in the handler and improve IDE resolution of types for inline hinting/validation.

A notable sacrifice was that I had to set the type for the ResourceHandlerRequest in HandlerSignature to Any to get mypy to accept that the actual handler was using ResourceHandlerRequest not BaseResourceHandlerRequest.

Previously PyCharm (didn't test other IDE's) was not able to resolve types for ResourceModel or ProgressEvent. Type completion/validation now works as expected.

2019-11-08_13-53-42
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

jaymccon and others added 3 commits November 8, 2019 13:50
@jaymccon jaymccon mentioned this pull request Nov 20, 2019
A nice side-effect of using `_` is that the schema forbids properties from beginning with that character, so clashes shouldn't be possible.
@tobywf
tobywf requested a review from johnttompkins November 20, 2019 20:31
@tobywf
tobywf merged commit e475585 into master Nov 21, 2019
@tobywf
tobywf deleted the cleaner_type_hints branch November 21, 2019 01:45
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