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
Python 3.2 compatibility #50
Comments
I personally haven't made the switch to 3 yet (even for a pet project, I know, it's dumb). Would it suffice to replace |
Oh, I didn't get that you weren't trying to do the switch yet :-) |
I just wrote these 2 commits that fixed my problems This one is just about the way i prefer to get extract results I also tried it on a python 2.7 installation and nothing seems broken Python 3:
Python 2:
|
@hangtwenty's approach sounds reasonable. However, I'm not seeing any install errors for Python 3. Output below:
|
Indeed, it happens with python3.2 and not with python3.4.
You won't find a unicode() function on python3+ |
but more importantly... is this a job for 2to3? |
@hangtwenty The piece of code you wrote will ensure compatibility with both Python versions, it's a good point. 2to3 usage here is completely overkill: if you take a look at my commits, you will see that a very little change fixes everything. IHMO, switching to 3 for tldextract can be done easily, without useless suffering, but I have no idea how other libraries manage python versions. Now, a little warning: give another name to your "unicode" function or you will enter a recursion loop |
@Agmagor good call on that naming issue, fixed |
This thread is starting to remind me why I only listed 3.3 as compatible. ;) I'd be curious what 2to3 does just for the troublesome lines for Python 3.2. However the |
Notice that
Here is the diff output I got using 2to3 tool : https://gist.github.com/Agmagor/dbe542ce4df63b49222a Thank you for your interest on this issue :-) |
I see 2to3 is more forward-only. Oh well. The |
Partly addresses #50. Uniformly export `unicode` helper.
I just noticed this line already exports a bridge similar to the |
It looks like this issue could be closed, no? Tests are running against a lot of Python versions. What is your opinion? |
I think @john-kurkowski 's comment above explained pretty well why 3.2 is annoying ... exactly to your point @mauricioabreu . But apparently we are almost there. See comment right above yours, @mauricioabreu : #50 (comment) |
@hangtwenty ok, after reading it I think we lack of tests/coverage, right? |
@mauricioabreu actually just fixing tests seemingly. Read #50 (comment) |
@hangtwenty ok, I got it. Thanks! |
Another option is to close this. No requestor activity in over a year. I'm not dead set on supporting old Python 3.x. 3.3-5 have far more users. |
I tried to use
So yeah @john-kurkowski given lack of requestor activity let's close this. |
Since Python 3, all strings are unicode so the u'...' notation do not make sense anymore.
One can't install your package on a Python 3 installation because of the return statement of this function
The text was updated successfully, but these errors were encountered: