Skip to content

Type hinting overhaul. - #219

Merged
Kircheneer merged 1 commit into
developfrom
typing-overhaul
Aug 18, 2023
Merged

Type hinting overhaul.#219
Kircheneer merged 1 commit into
developfrom
typing-overhaul

Conversation

@Kircheneer

@KircheneerKircheneer commented Mar 17, 2023

Copy link
Copy Markdown
Contributor

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

@KircheneerKircheneer added this to the 2.0.0 milestone Mar 17, 2023
@Kircheneer
Kircheneerforce-pushed the typing-overhaul branch 2 times, most recently from 70336ac to b0dcde9CompareMarch 17, 2023 14:53

@glennmatthewsglennmatthews left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work!

Comment threaddiffsync/__init__.py Outdated
Comment threaddiffsync/__init__.py
Comment threaddiffsync/__init__.py
"""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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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?

Comment threadpyproject.toml Outdated
This was referenced Jun 20, 2023
@Kircheneer

Copy link
Copy Markdown
ContributorAuthor

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?

@KircheneerKircheneer modified the milestones: 2.0.0, 1.8.0Aug 15, 2023
@Kircheneer
Kircheneer marked this pull request as ready for review August 17, 2023 15:12

@chadellchadell left a comment

Copy link
Copy Markdown
Contributor

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 developAug 18, 2023
@jdrew82
jdrew82 deleted the typing-overhaul branch March 27, 2025 22:36
Sign up for freeto 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.

Type hinting setup overhaul

3 participants

@Kircheneer@glennmatthews@chadell