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

typing fixes #8

Merged
merged 5 commits into from
Dec 18, 2024
Merged

typing fixes #8

merged 5 commits into from
Dec 18, 2024

Conversation

jorenham
Copy link
Contributor

@jorenham jorenham commented Dec 5, 2024

  • replaced NoReturn with None, as NoReturn is the "bottom type" (i.e. the subtype of all types, the opposite of object, equivalent to typing.Never), and used to annotate functions that never return (e.g. because of a sys.exit or infinite loop).
  • use MutableMapping instead of Mapping, which is closer to the actual dict it annotates, and so it can be used for mdit.options["mdformat"], as well.
  • pass the missing generic type arguments to (Mutable)Mapping for the (incorrectly contravariant) key and (covariant) value types. I assumed that the config values can only assume int (implicitly including its subtype bool), str, or Sequence[str]
  • introduced a type-alias (without TypeAlias, which requires python<3.10) for the config options for the sake of DRY
  • combined the {**_, **_} and the dict.update in update_mdit (kinda off-topic, but I couldn't help myself)

@jorenham
Copy link
Contributor Author

jorenham commented Dec 6, 2024

I believe that CI failure is the same codecov issue that we ignored in #5

@csala
Copy link
Owner

csala commented Dec 18, 2024

@jorenham This has conflicts with the previous PR. Would you mind checking them?

@jorenham
Copy link
Contributor Author

@jorenham This has conflicts with the previous PR. Would you mind checking them?

✔️

@csala csala merged commit 91bf7ee into csala:master Dec 18, 2024
7 of 13 checks passed
@csala
Copy link
Owner

csala commented Dec 18, 2024

Thanks @jorenham !

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