Python 3

65 views
Skip to first unread message

Lee

unread,
Oct 23, 2013, 11:36:41 AM10/23/13
to django...@googlegroups.com
Is there any particular advantage of using Python 3 at this point specifically in regards to Django projects? I'm starting to build a new application and I am wondering whether its really worth considering the move to Python 3. I've only really read about the disadvantages (3rd party libs mainly) and have seen very little relating to any specific advantages.

Thanks

Thomas Weholt

unread,
Oct 23, 2013, 11:39:23 AM10/23/13
to django...@googlegroups.com
My main reason to porting as many as possible of my python projects to Python 3 is proper unicode support. As a Norwegian developer is been terrible to support local characters in some projects with lots of dirty hacks to get it working. In py3 it just works.

Thomas


On Wed, Oct 23, 2013 at 5:36 PM, Lee <lee.dob...@gmail.com> wrote:
Is there any particular advantage of using Python 3 at this point specifically in regards to Django projects? I'm starting to build a new application and I am wondering whether its really worth considering the move to Python 3. I've only really read about the disadvantages (3rd party libs mainly) and have seen very little relating to any specific advantages.

Thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fcab2249-1b88-405a-9106-dd2b544d3d07%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

Andreas Kuhne

unread,
Oct 23, 2013, 5:15:19 PM10/23/13
to django...@googlegroups.com
Thomas, interesting.

Being a scandinavian developer myself, can you give me some examples where Python 3 has worked better for unicode support?

Regards,

Andréas

2013/10/23 Thomas Weholt <thomas...@gmail.com>

Xavier Ordoquy

unread,
Oct 24, 2013, 1:48:09 AM10/24/13
to django...@googlegroups.com
Hi Andréas,

The thing with python3 is it dropped implicit conversion between binary and "textual" strings. That means that:
- you now need to explicitly encode or decode if you need to switch the type of string you're using
- any conversion issue will be risen even if you're just using plain ascii charset

With python 2, encoding / decoding error where more random because the API were not always clear whether they need a string or a unicode and it depended on the string value itself.
In python3 this kind of error will happen right from the start.
While I've been porting things to python3, I've seen a couple of places where there was latent encoding/decoding errors that weren't identified before.

Also I love Python3 for being more explicit than Python 2.
Another example: import path now only use absolute path. If you want to use a relative import, you'll need to be explicit about it (say from . import models).

Best regards,
Xavier,
Linovia.


Reply all
Reply to author
Forward
0 new messages