News for hackers. Stuff that matters.
Re:Python For The Web by codygman on Tuesday October 18, 2011 @10:45PM (#3128365)
Everything unencoded is unicode in 3 isn't it?
Re:Python For The Web by lloeki on Wednesday October 19, 2011 @08:44AM (#3129862)
Strings are unicode. Bytes are encoded data.

With Python 2 strings you have to be proactive about it and - always use u"" unless you know what you're doing - segregate non-unicode data to boundaries by decode()ing early and encode()ing late, or you're guaranteed to shoot yourself in the foot sooner or later

but if you do it it's quite smooth sailing.

Also,

    #/usr/bin/env python
    # -*- encoding: utf-8 -*-
helps a lot.

All that just brings you closer to Python 3 anyway and really helps when using 2to3.

Re:Python For The Web by ashrust on Wednesday October 19, 2011 @12:50PM (#3130941)
Agreed, however I've run in to compatibility issues with 3 a few times and so resolved to stick w/ 2, deal with the text parsing issues myself, keep the libraries I like and leave the ops team alone.