dflook / python-minifier

Transform Python source code into its most compact representation
MIT License
553 stars 40 forks source link

does not remove annotation from conditional inner function #96

Open wrohdewald opened 10 months ago

wrohdewald commented 10 months ago
def ruleset(self, value:str) ->None:
    if True:
        def write() ->str:
            return 'update'

returns

def ruleset(self,value):
        if True:
                def A()->str:return'update'

expected

def ruleset(self,value):
        if True:
                def A():return'update'
dflook commented 10 months ago

Hi @wrohdewald, what version of python-minifier are you using and with what options? With 2.9.0 I do get:

def ruleset(self,value):
    if True:
        def A():return'update'
wrohdewald commented 10 months ago

Python 3.11.2 on Debian Bookworm, and

wrpc:/usr/local/lib/python3.11/dist-packages/python_minifier# pip3 list | grep mini
python-minifier     2.9.0