dflook / python-minifier

Transform Python source code into its most compact representation
MIT License
583 stars 43 forks source link

Syntax error when using 'match' in online minifier #43

Closed HoofedEar closed 2 years ago

HoofedEar commented 2 years ago

Using the online version, I tried minimizing this code:

def start(self):
    while self.tape_length != 0:
        try:
            self.current = self.tape.pop()
        except IndexError:
            break

        match self.current:
            case ".":
                self.output = not self.output

But I got a syntax error for line 9. And I replicated this issue using the larger source from which the above snippet resides and sure enough, same syntax error. Code snippet ruins in Python 3.10 without issue

dflook commented 2 years ago

Hello @HoofedEar, thanks for creating an issue. The online version does not support Python 3.10 yet. You'll need to install the package locally.

The online version runs in AWS Lambda, which doesn't have a Python 3.10 runtime yet. It typically takes quite a long time for new python version to become supported, but I'll update python-minifier.com as soon as it is.