Skip to content

Fix Hint.coerce_type not recognising falsey statements#126

Draft
Ultrasonic1209 wants to merge 5 commits intosanic-org:mainfrom
Ultrasonic1209:main
Draft

Fix Hint.coerce_type not recognising falsey statements#126
Ultrasonic1209 wants to merge 5 commits intosanic-org:mainfrom
Ultrasonic1209:main

Conversation

@Ultrasonic1209
Copy link
Copy Markdown

@Ultrasonic1209 Ultrasonic1209 commented Sep 4, 2022

Describe what bug you fixed
This PR fixes Hint.coerce_type so that it correctly recognises falsey statements.

Checklist

  • I've already read the contributing guide.
  • I've run all tests and make sure all exists test cases are passed.
  • I've make sure this PR works with Sanic-18.12 and Python-3.5.

@Ultrasonic1209 Ultrasonic1209 changed the title Main Fix Hint.coerce_type not recognising falsey statements Sep 4, 2022
@ahopkins ahopkins marked this pull request as draft September 4, 2022 12:45
@ahopkins
Copy link
Copy Markdown
Member

ahopkins commented Sep 4, 2022

This still needs some more work to handle

    @dataclass
    class Query:
        maybe: Optional[bool] = None

And particularly when dealing with [None].

@ahopkins ahopkins self-assigned this Sep 4, 2022
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