News for hackers. Stuff that matters.

Ask HN: What do you want to see in Python?

Howdy HackerNews!

I'm interested in HackerNews feedback and feature requests for Python. I am posing this question to the garrulous HN crowd, so I'm excited about it, and I'm sure this will be interesting!

Please include in your replies the following bullets: - HEADLINE: 1-line description of the request

- DESCRIPTION: A lengthier description of the feature. Bonus points for constructive criticism ;-)

We're super interested in your feedback!

Thanks, HN!

( 29 comments | 32 points | on HN )
Re:Ask HN: What do you want to see in Python? by marvinalone on Tuesday February 20, 2018 @12:07PM (#16421880)
Real threads.

For better or for worse, Python is the language of deep learning. We're going through all sorts of contortions to make it scale to large datasets, and the biggest problem is that Python is single-threaded for practical purposes.

I know all about the GIL and how difficult it is, but as a user, I don't care about any of that. The moment a similarly usable language comes along that does have working threads, I'll use it. I hope that language is also Python.

Re:Ask HN: What do you want to see in Python? by pilooch on Tuesday February 20, 2018 @01:30PM (#16422627)
C++ is the language of deep learning. Python is the scripting language on top of it.
Re:Ask HN: What do you want to see in Python? by zbyte64 on Tuesday February 20, 2018 @02:32PM (#16423349)
Real threads don't scale outside a single machine easily and it's adding allot of hazards that should be abstracted away. We don't want a dataset interface that makes a developer worry about race conditions. The pythonic way is to use one of those "contortions" because they are actually useful production-grade abstractions that let you scale beyond a single machine. Dask ( https://dask.pydata.org/en/latest/ ) is superior to threads for handling large datasets IMHO.

And if you're wanting something primitive then use cooperative threads like gevent, asyncio, or twisted.

Re:Ask HN: What do you want to see in Python? by mixmastamyk on Tuesday February 20, 2018 @12:37PM (#16422140)
Cython has “with nogil:” not sure if appropriate.
Re:Ask HN: What do you want to see in Python? by xiaodai on Tuesday February 20, 2018 @06:38PM (#16425390)
Unfortunately, Julia doesn't have a good multi-threading story as of yet. But `Base.@threads` works pretty in many cases, so perhap looking to that and the Knet.jl package?
Re:Ask HN: What do you want to see in Python? by deivid on Tuesday February 20, 2018 @12:29PM (#16422080)
why can't you use multiprocessing?
Re:Ask HN: What do you want to see in Python? by piker on Tuesday February 20, 2018 @12:32PM (#16422110)
Copy on write for large datasets = bad.
Re:Ask HN: What do you want to see in Python? by jackweirdy on Tuesday February 20, 2018 @09:38AM (#16420579)
- More explanation/docs of the concepts & structures in asyncio

- Some descriptions & examples of the constructs in the asyncio module, and what kind of problems you'd use each construct for would go a long way. IMO the API docs are too detailed to be able to learn from vs reference[0]. Perhaps a HOWTO is the kind of level I'd be looking for[1]. Or maybe this already exists but I'm using bad search terms.

[0] https://docs.python.org/3/library/asyncio.html [1] https://docs.python.org/3/howto/index.html

Re:Ask HN: What do you want to see in Python? by afarrell on Tuesday February 20, 2018 @07:51AM (#16419929)
Another LTS release would be cool. Toward the end of 2011[1], it was announced that python 2.7 that would be supported until 2020[2]. With 8 years of support, this effectively made 2.7 into an LTS release. It would help 2->3 migration efforts if there was a python 3.x LTS release.

[1] https://www.python.org/dev/peps/pep-0404/ [2] http://legacy.python.org/dev/peps/pep-0373/#update

Re:Ask HN: What do you want to see in Python? by odonnellryan on Tuesday February 20, 2018 @08:02AM (#16419986)
Isn't 3.x essentially LTS (team has decided on at least 12-2021) just without that name applied to it, just like you're saying about 2.7?

Sorry, I'm just a little confused.

Re:Ask HN: What do you want to see in Python? by Kihashi on Tuesday February 20, 2018 @09:41AM (#16420603)
From what I can see, they are doing 5 years for each 3.x point release[1].

> By default, the end-of-life is scheduled 5 years after the first release. It can be adjusted by the release manager of each branch. Versions older than 2.7 have reached end-of-life.

3.3 and lower and already considered end-of-life. 3.4 will be end-of-life next year.

I'm not sure if 5 years is a reasonable length to be considered LTS, but it seems like it should be long enough for most people.

[1]: https://devguide.python.org/#status-of-python-branches

Re:Ask HN: What do you want to see in Python? by Kihashi on Tuesday February 20, 2018 @09:51AM (#16420689)
My main pain points with python currently are distribution and GUI. PyInstaller is working fairly well at the former, but is by no means perfect. For GUI, there are a lot of options, but they all come with suboptimal trade-offs (licensing, non-native look, dated look, etc).

The recent features that have been added have been amazing, though. The new Windows installer, type hinting, asyncio, and f-strings have all made my life easier.

Re:Ask HN: What do you want to see in Python? by singhrac on Tuesday February 20, 2018 @10:12AM (#16420890)
I definitely agree - I've always felt frustrated by the quality of GUI toolkits in Python. Pyglet and Kivy seem like the best I could see (PyQt is licensed), but everything in the 'gallery' seemed sort of simplistic or

On a similar note, it would be really helpful if library maintainers (e.g. PyGame) would express somewhere that they're looking for a designer to help make their website easier to use. I'd offer my (very basic) help, but I'm worried about offending someone if I ask to redo their website. This isn't necessarily porting to a 'minimalist' or 'modern' theme, but simple things like emphasizing the intended UX, increasing readibility, organizing in a helpful way (e.g., a gallery should be split by type of application so that a business doesn't have to trawl through a bunch of games wondering if they can use this for their application).

Re:Ask HN: What do you want to see in Python? by Kihashi on Tuesday February 20, 2018 @10:17AM (#16420928)
I'm keeping an eye on the BeeWare project[1]. They seem to be doing interesting work in both of those spaces as well as mobile development. They also do a very good job of helping new contributors[2].

[1]: https://pybee.org/

[2]: https://pybee.org/contributing/how/first-time/

Re:Ask HN: What do you want to see in Python? by sli on Tuesday February 20, 2018 @10:19AM (#16420943)
I'd like to see van Rossum drop his anti-functional sentiment, but at the same time I suppose there are much better languages for that.
Re:Ask HN: What do you want to see in Python? by _sdegutis on Tuesday February 20, 2018 @11:02AM (#16421293)
Actual anonymous functions. Not just lambda expressions.
Re:Ask HN: What do you want to see in Python? by mixmastamyk on Tuesday February 20, 2018 @12:31PM (#16422103)
Subjective but makes for unreadable code.
Re:Ask HN: What do you want to see in Python? by scolvin on Wednesday February 21, 2018 @02:39AM (#16427648)
1. Type safety!

Run time type hint checks in the standard library, small performance impact allowed.

2. Compilation/optimisation using your hints

Like cython but using python's own type hints so you can give the compiler type information without leaving valid python.

Re:Ask HN: What do you want to see in Python? by ram_rar on Wednesday February 21, 2018 @04:52AM (#16428243)
As a python aficionado, I am really concerned that Python might eventually become the new Perl. Golang has pretty much replaced python for most of infra level projects.

1. Python needs to get JIT support (interfaces to dynamically JIT), beyond PyPy.

2. Type Safety. Type hinting is a good start. I love the direction projects like mypy is going. Allow programmers to mention types for functions which can be then JITed.

Re:Ask HN: What do you want to see in Python? by tonyedgecombe on Tuesday February 20, 2018 @11:46AM (#16421693)
Packaging still seems cumbersome to me although to be fair I don't think any language/community has sorted this yet.
Re:Ask HN: What do you want to see in Python? by jordiburgos on Thursday February 22, 2018 @11:11AM (#16438561)
PIP, Anaconda, environments, ... too many concepts for a newbie. And too tedious for the experienced.
Re:Ask HN: What do you want to see in Python? by mixmastamyk on Tuesday February 20, 2018 @12:23PM (#16422025)
Python has just about everything it can have without breaking compatibility. Also believe 3.7 is in feature freeze.

The remaining hurdle appears to be performance. Perhaps bundling cython or pypi is doable?

Re:Ask HN: What do you want to see in Python? by xiaodai on Tuesday February 20, 2018 @06:37PM (#16425378)
Successful Gilectomy so we can use shared-memory multi-threading!
Re:Ask HN: What do you want to see in Python? by vgy7ujm on Tuesday February 20, 2018 @04:31PM (#16424387)
Curly braces, non-significant whitespace, sigils...
Re:Ask HN: What do you want to see in Python? by vgy7ujm on Tuesday February 20, 2018 @04:40PM (#16424470)
Oh wait, we already have that. It's called Perl! :-D
Re:Ask HN: What do you want to see in Python? by jklein11 on Tuesday February 20, 2018 @07:29AM (#16419829)
Remove the GIL
Re:Ask HN: What do you want to see in Python? by nishparadox on Tuesday February 20, 2018 @09:39AM (#16420591)
gilectomy might not be coming around soon, I guess.
Re:Ask HN: What do you want to see in Python? by ivanjaros on Tuesday February 20, 2018 @07:46AM (#16419909)
Brackets, ffs.
Re:Ask HN: What do you want to see in Python? by 52-6F-62 on Tuesday February 20, 2018 @01:14PM (#16422483)

    from __future__ import braces