Skip to content
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

Added type hints to 3-tier structural pattern #330

Merged
merged 2 commits into from
Jun 25, 2020
Merged

Added type hints to 3-tier structural pattern #330

merged 2 commits into from
Jun 25, 2020

Conversation

rednafi
Copy link
Contributor

@rednafi rednafi commented Jun 22, 2020

  • Added type hints with proper generic types
  • Converted .format based string formatting to f-string based formatting to avoid mypy string interpolation error
  • Fully type-checked with mypy
  • Formatted with black formatter with default config



class Ui:
""" UI interaction class """

def __init__(self):
def __init__(self) -> None:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only objection is with the None returns. Can you give me examples of other projects that use it? I don't see an added value.

Copy link

@namelivia namelivia Jun 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its part of the convention here is the discussion that leads me to believe that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's an example from Black formatter's source code.

@faif faif merged commit a79d012 into faif:master Jun 25, 2020
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