Closed hukkin closed 4 years ago
With the current Map.__init__ type annotation, type checkers raise errors for some perfectly valid ways to initialize a Map. Some examples are:
Map.__init__
Map
from immutables import Map # 1. Map(**{"a": 1}, b=2) # 2. Map(a=1, **{"b": 2}, c=3) # 3. Map(col=1)
None of these three is valid from a type checker point of view, but all of them are working Python code at runtime.
This PR attempts to improve Map.__init__ type annotation so that type checkers are happy with the above code.
Looks like there's a conflict now, please rebase.
:+1: did the rebase @1st1
Thank you!
With the current
Map.__init__
type annotation, type checkers raise errors for some perfectly valid ways to initialize aMap
. Some examples are:None of these three is valid from a type checker point of view, but all of them are working Python code at runtime.
This PR attempts to improve
Map.__init__
type annotation so that type checkers are happy with the above code.