Lucretiel / autocommand

Autocommand turns a python function into a CLI program
GNU Lesser General Public License v3.0
53 stars 9 forks source link

Syntax error in function definition? #10

Closed j00bar closed 9 years ago

j00bar commented 9 years ago
$ sudo pip install autocommand
Downloading/unpacking autocommand
  Downloading autocommand-2.0.1.tar.gz
  Running setup.py (path:/tmp/pip_build_root/autocommand/setup.py) egg_info for package autocommand

Installing collected packages: autocommand
  Running setup.py install for autocommand
      File "/usr/local/lib/python2.7/dist-packages/autocommand.py", line 194
        module=None, *,
                      ^
    SyntaxError: invalid syntax

Successfully installed autocommand
Cleaning up...
Lucretiel commented 9 years ago

What version of Python is this on? That's the keyword-only argument syntax that was added in PEP 3102 to Python 3:

def function(arg, *, positional):
    pass

function(1, 2)  # TypeError
function(1, positional=2)  # OK

I made the decision to have this library be Python 3 only, so that inspect.signature can be used instead of the much more unwieldy getfullargspec.

j00bar commented 9 years ago

Py2.7 - so I suppose disregard. Thanks!