hauntsaninja / no_implicit_optional

A codemod to make your implicit optional type hints PEP 484 compliant.
MIT License
79 stars 8 forks source link

Support for T.Optional variant #10

Closed EmilStenstrom closed 1 year ago

EmilStenstrom commented 1 year ago

Hi!

I have some code that uses the idiom:

import typing as T

def test(param: T.Optional[str] = "hello"):
    ...

The command in this repo turns this into Optional[T.Optional[str]] and adds an unessesary import. I think this way of writing is fairly popular (?). If it is, would it be possible to add support for this variant too?

hauntsaninja commented 1 year ago

Thanks, released in 1.3