News for hackers. Stuff that matters.
Re:Making Python 3 more attractive by iandanforth on Wednesday April 15, 2015 @01:56AM (#9379124)
Nothing in that article matters to me and I use Python every single day. I guess if you know too much about a thing it's easy to lose sight of what "normal" users care about. So here's my list:

1. Speed

2. Language warts (e.g. del, __init__, import *, while: else:)

3. Lack of a modern UI toolkit

4. No native support in Android, iOS, or Browsers worth mentioning.

Right now Python is the perfect prototyping, glue, and modest workload language.

You can make it better for heavy loads by fixing 1. You can make it even more attractive to novice programmers by fixing 2.

But you really have to get to 3 or 4 before it becomes truly attractive and you get a mass adoption.

Re:Making Python 3 more attractive by MichaelMoser123 on Wednesday April 15, 2015 @02:45AM (#9379253)
regarding the speed issue: i looked at python 2.7 - here the interpreter is creating a dictionary for each function frame, now local variables are looked up by name of variable in this dictionary ! (globals have their separate namespace dictionary)

(i made a tracing tool that traces a python program and prints out all accessed variables - it actually makes use of this by-name-lookup-feature http://mosermichael.github.io/cstuff/all/projects/2015/02/24... )

i think that's quite wasteful, fixing variable access so that it is by some internal index and not by name would probably be a big improvement, even without changing the global interpreter lock.

Re:Making Python 3 more attractive by jeorgun on Wednesday April 15, 2015 @03:07AM (#9379324)
Closures might make this difficult, since a variable might be referenced by name before it's defined in any scope.
Re:Making Python 3 more attractive by sanxiyn on Wednesday April 15, 2015 @03:23AM (#9379365)
Variable access already works by index, not by name. Normally, LOAD_FAST and STORE_FAST are used.
Re:Making Python 3 more attractive by vacri on Wednesday April 15, 2015 @02:06AM (#9379154)
I always found it weird that python functions quite happily tell you that you're missing a colon, but can't 'just run' without it.

Excluding one-liner syntax, why does Python actually need a colon to define a function, given it's goal of being free of unnecessary syntactic elements? I'm only an intermediate pythonista, but I'd be interested to know if there was a particular point to the colon.

Re:Making Python 3 more attractive by cma on Wednesday April 15, 2015 @02:16AM (#9379180)
It doesn't, it just is easier to scan. There isn't a goal of being completely free of syntactic elements, semicolons went because they were excessive and noisey, colons seem, at least to me (comparing with say, coffeescript) to make it less noisey.
Re:Making Python 3 more attractive by vacri on Wednesday April 15, 2015 @07:04AM (#9380092)
Thanks for the info, all.
Re:Making Python 3 more attractive by Tyr42 on Wednesday April 15, 2015 @02:27AM (#9379204)
It's because there's a rule that every time you are going to start indenting more, there's a colon first. Since whitespace is rather invisible, it's a concession they make to make scoping more clear.
Re:Making Python 3 more attractive by heinrich5991 on Wednesday April 15, 2015 @03:28AM (#9379381)
A few "unnecessary" syntactic elements help find errors at "compile time". In Javascript for example, automatic semicolon insertion can lead to very subtle errors.
Re:Making Python 3 more attractive by witty_username on Wednesday April 15, 2015 @02:04AM (#9379146)
PyQt I think satisfies "3"? Though it's not builtin.
Re:Making Python 3 more attractive by knappador on Wednesday April 15, 2015 @02:43AM (#9379248)
Don't count out Kivy for a modern UI toolkit, but speed and no requirement to include a runtime for distribution will not come for Python without a different approach to execution.
Re:Making Python 3 more attractive by zem on Wednesday April 15, 2015 @05:04AM (#9379707)
what's wrong with qt as a modern ui toolkit? python seems to be one the best supported languages as far as qt bindings go.
Re:Making Python 3 more attractive by palmstroem on Wednesday April 15, 2015 @10:47PM (#9385636)
Have you ever tried to deploy a native looking Python3 qt app on both Mac and Windows? I am not aware of anyone who lived to tell the tale. If you can do without a native look (menus, dock icons, app packaging), i.e. you just want to have some academic lab tool, then qt is good enough, IMHO. But no comparison with native UI development on Win or Mac.
Re:Making Python 3 more attractive by zem on Thursday April 16, 2015 @03:07AM (#9386336)
no, linux only. i'll admit that i wasn't taking native look into account, but then again, no default gui toolkit would be likely to have a native l&f anyway - you'd want to use the platform-native bindings for each platform separately, if that was a strong concern.
Re:Making Python 3 more attractive by dagw on Wednesday April 15, 2015 @05:08AM (#9379725)
Nothing per se. However the situation with two competing python bindings and no official out of the box support or blessing of either makes it non-obvious as to what the 'correct' way to write and ship GUI apps in python is.

If I just want to wrap a simple GUI around some functions then going down the qt route is currently far to 'heavy'.