-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error installing pyRdfaExtras due to tuple unpacking using Python 3.3 #7
Comments
Without checking, I believe the tuple unpacking is fixed by 2to3 - maybe pyrdfa3 lacks a proper setup script that includes running 2to3, but pyrdfa is included in rdflib>4, there the installation defn. works for 3.2 and 3.3 |
Actually checking, looks like it's exactly what happened: http://www.python.org/dev/peps/pep-3113/#transition-plan |
gromgull: Thanks. Yes, if setup.py included a 2to3 step in this repository, that would correct the problem here, but it doesn't. Alternately, given that manually unpacking the tuples works in both Python 2.x and 3.x, I could work up a branch that removes the need for 2to3 for that purpose (leading to more legible code for those used to Python 2.6+). Not requiring a transform step should also make it easier for new contributors to pull the code from git & test & run it. |
Dan, sorry about that; I took care of this (and updated github). As for the RDFLib core package, I wonder why this problem has not manifested itself already. I will forward your mail to those who really maintain the package... Cheers Ivan On Aug 12, 2013, at 17:58 , Dan Scott notifications@github.com wrote:
Ivan Herman |
i'll close this in favor of #9 for now, reopen if necessary |
Although README.txt claims "The package has been adapted to Python 3", attempting to install pyrdfa3 under Python 3.3 fails with a syntax error in the pyRdfaExtras directory.
Steps to reproduce:
virtualenv --python=/usr/bin/python3.3 ~/schema_rdfa
git clone https://github.com/RDFLib/pyrdfa3.git
cd pyrdfa3
~/schema_rdfa/bin/python setup.py install
...
byte-compiling /home/dan/schema_rdfa/lib/python3.3/site-packages/pyRdfaExtras/init.py to init.cpython-33.pyc
File "/home/dan/schema_rdfa/lib/python3.3/site-packages/pyRdfaExtras/init.py", line 112
def add(self, (s,p,o)) :
^
SyntaxError: invalid syntax
It looks like Python 3 dropped support for using tuples directly in method signatures like this five years ago via PEP 3113 (http://www.python.org/dev/peps/pep-3113/) with warnings added as of Python 2.6. I expect the alternative would be something like "def add(self, triple)" and then checking to ensure that triple[0], [1], and [2] were all defined.
Looking over RDFlib itself, it seems that the API is rife with tuple unpacking behaviour :/
The text was updated successfully, but these errors were encountered: