wordnik / wordnik-python

Wordnik Python public library
227 stars 47 forks source link

InvalidSyntax on Python 3 (True/False attribute) #15

Closed jaraco closed 10 years ago

jaraco commented 12 years ago

Many of the wordnik model classes attempt to set the attributes 'True' and 'False' on the class. It turns out this Syntax is not valid on Python 3. For example, in CaseSensitiveValues:

class CaseSensitiveValues:
    """
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
    def __init__():
        self.True = "true";
        self.False = "false"

That syntax makes Wordnik simply unusable on Python 3 (as it's not possible to even import the wordnik modules). Furthermore, that generated code appears to be unusable.

>>> import wordnik.model
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "env\Python33\site-packages\wordnik-2.0-py3.3.egg\wordnik\model\__init__.py", line 7, in <module>
    __import__(module[:-3], locals(), globals())
ImportError: No module named 'ApiTokenStatus'

I'm not sure what needs to be done, whether update the code generator or the underlying API or patch the generated code.

Please let me know if I can help getting Python 3 support for the API.

mrjf commented 12 years ago

It's true, this lib only supports Python 2. We are going to release a Python3 version soon, will update this ticket when we do. Thanks for writing.

hugovk commented 10 years ago

Python 3 version is here:

https://github.com/wordnik/wordnik-python3

(This issue can be closed.)

jaraco commented 10 years ago

ugh. Sorry to hear Wordnik has gone down the road of having a separate library for Python 3. Now my project needs to depend one one library or the other depending on the target environment. Thanks at least for having some offering.