![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,790
Karma: 507333
Join Date: May 2009
Device: none
|
Python 3 - Safe to use/convert to?
Anybody trying to do work/convert their scripts to Python 3?
Any verdicts, problems, pitfalls you could share with the rest of us? - Ahi |
![]() |
![]() |
![]() |
#2 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,249
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Python 3 has changed enough so it's not backwards/forwards compatible. All the scripts used to remove DRm won't work with Python 3 and anything you code with Python 3 most likely won't work with 2.5.x or 2.6.x. So basically it's a botch job (IMHO) due to compatibility issues.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,790
Karma: 507333
Join Date: May 2009
Device: none
|
Quote:
When dealing with Unicode text, I get the impression it ought to be a bit more straightforward... but I fear pitfalls in this still rather young release. Further clarification: I meant "convert to" in the sense of "converting scripts to", not in the sense of "switching your primary Python installation to". I rather agree with JSWolf that doing so would probably be foolhardy at this time... unless concurrent installations are possible, with Python 2 remaining the default. - Ahi Last edited by ahi; 09-18-2009 at 01:26 PM. |
|
![]() |
![]() |
![]() |
#4 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,249
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I don't think Python 3 will take off unless they can fix it so it also runs 2.5.x/2.6.x code without any modification.
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,221
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Python 3 is significantly slower because of it representing all string internally as ucs 2 or 4
Most 3rd party modules haven't been ported/have bugs with python 3 Note that using __future__ you can write code that will run correctly on both 2.6+ and 3.0. For new projects that's what I would recommend |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,790
Karma: 507333
Join Date: May 2009
Device: none
|
Quote:
Though, to be frank, I suspect that for those with a bit of system administration knowledge (like the Ubuntu maintainers, web hosts, et al) running both Python 2 and Python 3 concurrently is probably trivial. Hence I'm not convinced this is actually a problem. Here's a list of changes/conversion notes for Python 3. My interest is piqued. - Ahi |
|
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,221
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I have python 2.4, 2.5, 2.6 and 3.1 on my machine
![]() |
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,790
Karma: 507333
Join Date: May 2009
Device: none
|
Quote:
But I will check out __future__. Portability would still be nice. I'm guess though it is far from effortless. Was it problematic to set them up? - Ahi |
|
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,221
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yeah, you have to know what you're doing to use __future__ correctly.
I use gentoo, a source based linux distro, which actually sets up the multiple python instances automatically for me ![]() |
![]() |
![]() |
![]() |
#10 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,790
Karma: 507333
Join Date: May 2009
Device: none
|
Quote:
I now settle for whatever Ubuntu maintainers think up for me... with only the occasional attempts to try to do the inconvenient thing they did not think of doing. - Ahi |
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,221
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Python is designed to work well with multiple instances, so it shouldn't be hard to do.
Basically, just compile it from source and install into different prefixes, then setup appropriate symlinks pointing to the different versions in /usr/local/bin or wherever And make sure you dont have any PYTHON* environment variables |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is ebook-convert thread safe? | Takeshi_12 | Calibre | 3 | 05-12-2010 03:38 PM |
Mirasol Displays..Safe? | LDBoblo | News | 5 | 04-01-2010 07:39 PM |
is it safe to.... | Pushka | Calibre | 4 | 02-15-2010 07:52 AM |
Accessories Want a safe Kindle 2 - what cover? | Ea | Amazon Kindle | 26 | 10-24-2009 07:57 AM |
Purchasing from jinke.com.cn. Is it safe? | July | HanLin eBook | 12 | 07-23-2008 12:38 PM |