4 ms·
> Not much has changed in python 3? What rubbish. You just have to look at the thousands of commits, and change lists. Sorry, I'll have to disagree with your d
by rdtsc 12y ago
> Not much has changed in python 3? What rubbish. You just have to look at the thousands of commits, and change lists.
Sorry, I'll have to disagree with your disagreement. Thousands of commits doesn't mean it is worth breaking backwards compatibility. Unicode support? Yeah it is nice. But it worked fine for me before. Print is a function. Again, pretty nice, not nice enough to break backwards compatibility.
> Python 3.4 has generic functions to do single dispatch matching on type.
Ok. Never really needed that in Python. So again not worth breaking backwards compatibility.
> There is the new asyncio library for really elegant async,
That is a bad idea. Promises and futures are not a very good concurrency construct. Light threads, processes and message passing are better. Twisted has been around for ages, and even though it is used here and there it hasn't exactly taken the world by storm yet. So I certainly don't see it as a positive, rather it is a negative. I would rather they adopted greenlet and supported gevent better or integrated PyPy's STM
> We have CFFI for simpler FFI.
Ok, I just used CFFI in Python 2 last week, worked great.
> Lambdas are kept simple for readability, as functions are preferred.
Heavy lambda usage is not that good of a practice in Python. And Python 2 has lambdas as well. It use them sparingly.
> I'm just going to stop here..
Oh no, please don't stop, because you haven't convinced many people Python 3 is better.
> You can statically type check python now (see pysonar2, pylint, and pycharm for example)
You know what has better static type checking? Go. I am sitting down looking at static type checking and fixing code for backward compatibility, I will also be evaluating other languages and platforms.
Python 3 is not bad. But is is not that much better than Python 2. Sorry. A lot of that is not Python 3's fault as much as a testament to how good Python 2 already was.
I think Python 3 should have offered a lot more than unicode and print as a function. A list of possible improvements:
* A JIT compiler
* An STM module
* Better concurrency (removed GIL)
* Maybe integrated requests or flask or some other modern web tools and libraries
- orf 12y agoRidiculous. Python 2 has many many warts and the right thing to do was to fix them. Why the heck is print a statement? Why do we have urllib and urllib2? Why are generators not that useful? >> That is a bad idea. Promises and futures are not a very good concurrency construct. Light threads, processes and message passing are better. Not so much in Python I'm afraid. The new asyncio module is worth the switch by itself I find, while Twisted is pretty good it can be very verbose and suffers from a number of issues. You say that it's not worth breaking backwards compatibility for genuine warts in the language and seem to think it's only worth progressing the language if its by implementing huge changes like adding a JIT or removing the GIL (why you would think of bundling requests or flask with Python is beyond me). Python 3 may not have those big blockbuster features but its a nicer language with fewer warts (from __future__ import division? please). I gave Python 3.4 a try while porting a Twisted application to asyncio and I was very surprised. After using it in a couple of Django projects I have yet to come across any packaging issues, and I use the awesome 'six' library so my code runs on 2 and 3 without modification.
- jd007 12y agowhats a good and performant mysql library for python 3 to use? or did you use postgres for all those projects?
- Earwig 12y agoHow about oursql (https://pythonhosted.org/oursql/ https://pythonhosted.org/oursql/)?
- orf 12y agoI used postgres for all the projects I'm afraid, but the Mysql team provide a db-api compatible library here: http://dev.mysql.com/downloads/connector/python/ http://dev.mysql.com/downloads/connector/python/ that supports Python 3
- rdtsc 12y ago> Why the heck is print a statement? Why do we have urllib and urllib2? Why are generators not that useful? So what if it is. Why not just make prnt a function. Or println or something. Have urllib and urllib2. Make urllib2 or just put requests in the stdlib. Still don't see what was worth breaking backward compatibility over. > You say that it's not worth breaking backwards compatibility for genuine warts in the language and seem I say it is not worth doing it at the time they did. It just came too late. People how didn't pick python over other frameworks probably weren't put off by the print statement. This should have happened 5-10 years ago not now. Not it was time for better performance, packaging, web frameworks, better concurrency constructs. > ts by implementing huge changes like adding a JIT or removing the GIL (why you would think of bundling requests or flask with Python is beyond me). Removing the GIL shouldn't break sane code. With GIL you still have race conditions and have to guard against them. You just can't run CPU bound code in parallel. That would be nice to fix. And if it is beyond you read up on how JPython works because it doesn't have a GIL. > why you would think of bundling requests or flask with Python is beyond me) How does bundling a library like that break code? > I gave Python 3.4 a try while porting a Twisted application to asyncio and I was very surprised. I switched to using gevent from Twisted and saw speed improvement and code reduction by about 30-50%.
- meowface 12y agoI agree. Python 3 fixes a lot of warts (range() defaults to xrange(), input() is the default) and does make the language overall more elegant (arbitrary head and tail unpacking with splat) but unfortunately it's not really worth a full switch. At least not for me.
- illumen 12y agoA lot of the goodies from 3.3 were back ported into python 2.7, to ease portability. Python 3.4 makes it more backwards compatible still (whilst staying elegant). However, now there are also some new features that are not getting back ported. Using argument annotations for type checking is quite useful in IDEs and for statically checking your code. Asyncio, and yield from have been in the design phase for many years by Guido and the community. This is seriously well thought out concurrency done by people with lots of experience. It's the 4th generation async framework for python. The better unittest framework saves me time, and helps me with error handling. pip installed everywhere is a serious productivity improvement. Function dispatch based on type (ie, pattern matching like some functional languages) is something I've missed for years. It was originally planned for py3k, and I think is the main missing piece from the original design docs. Importlib is much improved, so you can do some really interesting things with importing code. If you're working on IDEs, or other apps like games this is pretty cool stuff. Little things like the enum module make APIs that tiny bit cleaner and more intuitive to use. Speaking of nicer APIs, the Documentation got a lot of fixups too in Python 3.4. Want to track down memory leaks? Python 3.4 has a whole new set of memory debugging primitives to make this much easier. There were also a lot of security improvements for 3.4 that have not been backported.