docopt / docopt.c

C-code generator for docopt language.
MIT License
318 stars 46 forks source link

Fixed docopt_c to work in python 3. #29

Closed tokuchan closed 7 years ago

tokuchan commented 10 years ago

There was only one problem, really. Python 3 doesn't understand the long keyword, since in python 3, longs are the same as ints. I added an if statement to detect which version of python is being used. It then either expects long or not as appropriate.

I tested this change by following the example, and everything seems to work.

keleshev commented 9 years ago

A better way would be to use numbers.Number, which is available since Python 2.6: https://docs.python.org/2.6/library/numbers.html#numbers.Number

keleshev commented 9 years ago

Yeah, sorry for late reply.