Skip to content

Conversation

@Kircheneer
Copy link
Contributor

@Kircheneer Kircheneer commented Mar 17, 2023

Closes #175. Things that happened here:

  • Fully type hint all function/method definitions
  • Active disallow_untyped_defs in mypy config in pyproject.toml
  • Replacing Mapping with Dict, Collection with List and Text with str, because all our mappings are dicts anyway, collections are lists (3.9 could use dict/list, maybe we can drop 3.8 support with 2.0?) and Text is only needed for backwards compatibility with Python 2.x which we aren't offering
@Kircheneer Kircheneer added this to the 2.0.0 milestone Mar 17, 2023
@Kircheneer Kircheneer force-pushed the typing-overhaul branch 2 times, most recently from 70336ac to b0dcde9 Compare March 17, 2023 14:53
Copy link
Collaborator

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

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

Nice work!

"""Exception raised when trying to store a DiffSyncModel or DiffElement that is already being stored."""

def __init__(self, message, existing_object, *args, **kwargs):
def __init__(self, message: str, existing_object: Union["DiffSyncModel", "DiffElement"], *args: Any, **kwargs: Any):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should existing_object just be an Any?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What other than DiffSyncModel or DiffElement would we store in a store?

@Kircheneer
Copy link
Contributor Author

Addressed all outstanding comments, rebased against develop and put it into a backwards-compatible state. Should be an easy-ish merge at this point I think?

@Kircheneer Kircheneer modified the milestones: 2.0.0, 1.8.0 Aug 15, 2023
@Kircheneer Kircheneer marked this pull request as ready for review August 17, 2023 15:12
@Kircheneer Kircheneer requested a review from chadell as a code owner August 17, 2023 15:12
Copy link
Contributor

@chadell chadell left a comment

Choose a reason for hiding this comment

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

LGTM

@Kircheneer Kircheneer merged commit 2c1577f into develop Aug 18, 2023
@jdrew82 jdrew82 deleted the typing-overhaul branch March 27, 2025 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants