Skip to content

Conversation

Glinte
Copy link

@Glinte Glinte commented Oct 12, 2025

Implicit None is an error in typecheckers now

mypy

ordered_set\__init__.py:66: error: Incompatible default for argument "initial" (default has type "None", argument has type "AbstractSet[T] | Sequence[T] | Iterable[T]")  [assignment]
ordered_set\__init__.py:66: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
ordered_set\__init__.py:66: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase

pyright

  ordered-set\test\test_ordered_set.py:91:12 - error: Argument of type "None" cannot be assigned to parameter "initial" of type "OrderedSetInitializer[T@OrderedSet]" in function "__init__"
    Type "None" is not assignable to type "OrderedSetInitializer[T@OrderedSet]"
      "None" is not assignable to "AbstractSet[T@OrderedSet]"
      "None" is incompatible with protocol "Iterable[T@OrderedSet]"
        "__iter__" is not present
      "None" is not assignable to "Sequence[T@OrderedSet]" (reportArgumentType)

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.

1 participant