5 ms·
Curious, what do you hate about Python 3, or is it just hating the migration process? (As someone who has to deal with a lot of Unicode content, I consider Pyt
by dheera 10y ago
Curious, what do you hate about Python 3, or is it just hating the migration process?
(As someone who has to deal with a lot of Unicode content, I consider Python 3 a blessing, but curious.)
- convolvatron 10y agoi dont do a lot of python, and i think 3 is an improvement but for me the real nightmare is all of the libraries. some have 2 and 3 support, some only 2, some with a 3 fork thats not maintained, etc etc. every time i try to start a project using 3 i end up wasting a lot of time and going back to 2 anyways
- 52-6F-62 10y agoThis is my major confusion as well. It seems not worth it to begin work in an older version because debt is inherent right at the start, and updating code (for a new language version) is a personal peeve (or irritant). It's irrational, so don't ask, but I avoid it everywhere I can. Of course, diving into the newer version also adds a lot of debt, and possibly a total impasse, due to the lack of libraries that have made the update. I guess it will be quite some time before it becomes foolish to still cling to py2
- cthalupa 10y agoWhat libraries are unavailable in Python 3? This gets mentioned in every hacknews thread on this subject, but I honestly don't believe I've seen any that weren't either already updated to support Python 3, or didn't have alternatives that worked just as well. https://python3wos.appspot.com/ https://python3wos.appspot.com/ has a list of the largest packages in pypi, and there's very few that aren't available in Python3. httplib2 is easily replaced by requests. Supervisor isn't a library, it's an application. Same with carbon and graphite-web. Basically the only things on that list are the mozilla libraries, but IIRC some of those are in progress of being ported anyway. Twisted is one of the few I can think of that still isn't there, but most of the core APIs are there, as well as a lot of secondary stuff - half a year ago, more than 90% of the unit tests were passing on python3.
- 52-6F-62 10y agoI can't offer you any kind of solid case. My Python experience is admittedly limited. I've been working to get more into it lately. Thanks for the resource. Can I ask if you see any reason to not abandon Python 2 altogether when starting a new development project?
- cthalupa 10y agoIf you control the deployment environment, none that I can think of. If not, and you need to deploy to RHEL/Cent 7, then maybe. They're still on 2.7, though software collections will let you install 3.x on either of them.
- 52-6F-62 10y agoOh thanks for the tip. I work with CentOS regularly, but haven't worked on a Python project in that environment yet.
- convolvatron 10y agoidk, two sound libraries, an image processing library. i've moved some forward, its not that hard. still seems like a mess
- mrks_ 10y agoPersonally, I haven't found any must-have libraries for Python 2 only that don't have a satisfactory Python 3 alternative.
- dozzie 10y agoI, being a sysadmin, still consider Python 3 this new, shiny thing that is yet to become widely used. Linux distributions still use Python 2 code for their infrastructure, so Python 3 is something big I would need to specifically order to install that would give me negligible gains.
- cthalupa 10y agoThe Red Hat family of distros being decades behind isn't really an indication that things they aren't using are new and shiny. Plenty of modern distros ship Python 3 as the default Python, including Ubuntu. RHEL6 still uses Python2.6! It's horrid. I'm also a sysadmin, and not a programmer. But I do a lot of my automation scripting in python, and have worked on a few larger projects in python, including one that's requirements meant it had to be Python2/3 compatible. I am not a fan of Python prior to 2.7 at all, and I think 2.7 is really just a bunch of bandaids trying to pull together a pretty crappy language, whereas 3.x is a joy to work with.
- dozzie 10y ago> The Red Hat family of distros being decades behind isn't really an indication that things they aren't using are new and shiny. I talk about how a sysadmin perceives the state of Python, and a sysadmin usually works with stable OSes. And you know what? Most of the major distributions commonly used for servers use Python 2 as the default interpreter. The list of these distributions includes Red Hat/CentOS 7, Debian stable (Jessie) and soon-to-be-stable (Stretch), and Ubuntu 16.04 LTS. > Plenty of modern distros ship Python 3 as the default Python, including Ubuntu. RHEL6 still uses Python2.6! It's horrid. Erm... You compare "modern distros" with a release that is on its LTS? You know you're being unreasonable, right? Not to mention that Python 2.7 was released in 2010, the very same year as RHEL 6. It's hard to hold it against Red Hat having this in mind. And how Ubuntu ships Python 3 as the default version? From what I see, in Ubuntu Zesty (17.04, i.e. the most recent release) package "python" has version 2.7.13-2. > I am not a fan of Python prior to 2.7 at all, Because...? > [...] I think 2.7 is really just a bunch of bandaids trying to pull together a pretty crappy language, Like...? > [...] whereas 3.x is a joy to work with. Becuase, in contrast to 2.x, it has the feature of...?
- Mizza 10y agoI have a whole blog post/rant brewing about that topic, but on the whole, I just think it feels like it was designed by committee rather than a visionary. They've abandoned the common usage case in favor of the corner case. It also makes it much harder to teach. A few quick examples: Base64 encoding returns bytes. Why would anybody _ever_ want that? The whole purpose of B64 encoding is to make something string-safe. It's also now invalid to have this as a project structure: Name/name.py (with a Name class) in it. Which I would say is literally the most sensible common project structure to have. Now you have to call the file with the name class 'core' or 'main' or anything besides the actual description of what it is. Of course, you'll get no help from the errors if you hit this problem. "Dictionary view objects" are horribly unsemantic and annoying to teach. How is the language improved by having this no longer work `k = d.keys(); k.sort()`? Just give me a list. I'm maintaining a fairly large and popular Python 2/3 project and all of the errors are coming from the Python 3 side, and the maintainability of the project has been decimated by needing to support both versions. They should have just made a 2.8 with asyncio and unicode strings. My hope is that somebody will make a new language that does to Python what Python did to C/Java. For day-to-day scripting, let's get really serious about programmer ergonomics, semantics and maintainability above all.
- goatlover 10y agoThere are other scripting languages that have good support and strong communities. There doesn't need to be yet another programming language. Use Ruby, JS or PHP 7 instead. If it's scientific computing, Julia fills the niche very nicely. Or R.
- Mizza 10y agoMy point is that we should go a level "higher" than any current offering. Ex, why not let me do something like this out of the box: get https://api.github.com/users/Miserlou as miserlou print "My name is " miserlou.name Transparent/automatic web requests, content-type checking, serialization parsing, string formatting, network reference parsing, etc. Let the user be more specific if they need to, but design heavily around the most common use case.