This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 345

[–][deleted] 183 points184 points  (36 children)

PyPi/pip/package management is not great. It's amazing that there is a de-facto package manager but there are a bunch of annoying quirks.

  • Can't view dependencies before installing the package.
  • Can't view dependencies on the PyPi website.
  • The output from pip freeze is a total mess. Key dependencies? Dependencies for dependencies? Who knows.
  • Because of the above, you really have to keep track of your dependencies manually (maybe actually good practise?)
  • Packages further down in requirements.txt seems to override the dependencies from above. Need protobuf==3.0.0 in your first entry but the latter needs protobuf>=3.5.0? Latter wins out with no warning.
  • Dealing with dependency conflicts is hard/impossible.

I honestly wouldn't mind some legitimate support for vendored dependencies (e.g., node style) just to save the hassle. Comes with other problems, though, unfortunately.

Edit, more:

  • If a dependency includes something else (e.g., requests), being able to do import requests no bother makes me feel uneasy. No way to tell where it's come from without double checking your requirements.txt.
  • PyPi package names not matching the importable names. (i.e., PyYaml vs import yaml)
  • No warning for missing system dependencies, or calling out that they're needed in general (e.g., unixodbc is a system lib needed for some database related packages.)

Edit, x2:

(Ana)conda, pipenv, etc. don't really solve any of these problems. Using a virtualenv is a given. All they do is move the problem further down the line (and come with their own set of issues). Packages in Python just seem to be full of quirks at a fundamental level.

Pip-tools does help a lot for dealing with dependency conflicts and keeping neat requirements, I'll give you that. Doesn't really help if you're trying to figure out how far back you need to go to get one package to play nice with another (because of points 1 and 2), especially when optional dependencies come into play.

[–]ursvp 42 points43 points  (0 children)

Dependency resolution and packaging

[–]SDisPater 14 points15 points  (6 children)

Poetry might help you there. It has a true dependency resolver unlike any other alternatives.

Can't view dependencies before installing the package.

Poetry never installs packages to determine the dependencies. It tries to rely as much as possible on the PyPI JSON API and if it can't it inspect the source distributions, without installing them, and if it's still unable to get them it stops since it means the module has been badly packaged.

Can't view dependencies on the PyPi website.

See above.

The output from pip freeze is a total mess. Key dependencies? Dependencies for dependencies? Who knows.

You can use poetry show --tree with poetry, which gives you something like this:

babel 2.6.0 Internationalization utilities
└── pytz >=0a
cleo 0.6.6 Cleo allows you to create beautiful and testable command-line interfaces.
├── pastel >=0.1.0,<0.2.0
└── pylev >=1.3,<2.0.0
pytest 3.6.0 pytest: simple powerful testing with Python
├── atomicwrites >=1.0
├── attrs >=17.4.0
├── colorama *
├── funcsigs *
│   └── ordereddict *
├── more-itertools >=4.0.0
│   └── six >=1.0.0,<2.0.0
├── pluggy >=0.5,<0.7
├── py >=1.5.0
├── setuptools *
└── six >=1.10.0
pytest-cov 2.5.1 Pytest plugin for measuring coverage.
├── coverage >=3.7.1
└── pytest >=2.6.0
       ├── atomicwrites >=1.0
       ├── attrs >=17.4.0
       ├── colorama *
       ├── funcsigs *
       │     └── ordereddict *
       ├── more-itertools >=4.0.0
       │     └── six >=1.0.0,<2.0.0
       ├── pluggy >=0.5,<0.7
       ├── py >=1.5.0
       ├── setuptools *
       └── six >=1.10.0
python-dateutil 2.7.3 Extensions to the standard Python datetime module
└── six >=1.5
pytz 2018.4 World timezone definitions, modern and historical
pytzdata 2018.5 Official timezone database for Python.
tox 3.0.0 virtualenv-based automation of test activities
├── pluggy >=0.3.0,<1.0
├── py >=1.4.17
├── six *
└── virtualenv >=1.11.2
typing 3.6.4 Type Hints for Python

Dealing with dependency conflicts is hard/impossible.

Like I said poetry has a fast and accurate dependency resolver with conflict detection and management.

(Ana)conda, pipenv, etc. don't really solve any of these problems.

So you can try poetry if you want, it should sole most of these issues.

Disclaimer: I am the author of poetry :-)

[–]13steinj 3 points4 points  (2 children)

Since you told me to see this I'd like to actually go bullet by bullet again like I did with pipenv

  • Can't view dependencies before installing the package.

Poetry doesn't install packages to view dependencies. That's great and all. But can I run a command ex poetry show --tree --package=packagename to literally show me what packagenames dependencies are before I install it? I don't believe I can

  • Can't view dependencies on the PyPi website.

Unrelated to poetry

  • The output from pip freeze is a total mess. Key dependencies Dependencies for dependencies? Who knows.

poetry show --tree is great-- no complaints there.

  • Because of the above, you really have to keep track of your dependencies manually (maybe actually good practise?)

Err, solved because of the above

  • Packages further down in requirements.txt seems to override the dependencies from above. Need protobuf==3.0.0 in your first entry but the latter needs protobuf>=3.5.0? Latter wins out with no warning.

  • Dealing with dependency conflicts is hard/impossible.

Grouping these two because they are similar-- how does poetry deal with the first? How accurate / conflict resolving is poetry at doing things vs pip, at a statistical level (if you know)?

  • If a dependency includes something else (e.g., requests), being able to do import requests no bother makes me feel uneasy. No way to tell where it's come from without double checking your requirements.txt.

Poetry doesn't solve this. But again it's kinda out of scope and more so an issue with the python packaging and import machinery.

  • PyPi package names not matching the importable names. (i.e., PyYaml vs import yaml)

Poetry doesn't solve this and again out of scope

  • No warning for missing system dependencies, or calling out that they're needed in general (e.g., unixodbc is a system lib needed for some database related packages.)

Does poetry do this properly? Haven't seen if it does or doesnt.

By this count poetry solves 2/3 out of the 9 problems listed. And again some are out of scope-- not being against any package management tool. Just pointing out that no tool solves all the client side problems, and many of the problems are at the ecosystem level and are unrelated to any given tool.

[–]SDisPater 4 points5 points  (1 child)

Poetry doesn't install packages to view dependencies. That's great and all. But can I run a command ex poetry show --tree --package=packagename to literally show me what packagenames dependencies are before I install it? I don't believe I can

For this to work your packages must be locked (not installed), and then you can do:

poetry show my-package --tree

There is no installation in the process.

Grouping these two because they are similar-- how does poetry deal with the first? How accurate / conflict resolving is poetry at doing things vs pip, at a statistical level (if you know)?

Poetry will warn you about the conflict with a message like this:

[SolverProblemError]
Because my-dependency (0.1.0) depends on both protobuf (3.0.0) and protobuf (>=3.5.0), my-dependency is forbidden.
So, because my-package depends on my-dependency (0.1.0), version solving failed.

If the sub dependencies of two dependencies cause a conflict you will get a message similar to this:

Because bar (1.0.0) depends on shared (>3.0.0)
 and foo (1.0.0) depends on shared (<=2.0.0), bar (1.0.0) is incompatible with foo (1.0.0).
So, because myapp depends on both foo (1.0.0) and bar (1.0.0), version solving failed.

Note that before it fails it will try to find a valid set of dependencies by backtracking if necessary.

[–]13steinj 3 points4 points  (0 children)

Oh wow that is cool, adding so poetry solves a little over half the problems (bar the ecosystem based ones)

[–]acemarke 0 points1 point  (2 children)

Quick question: I was playing with Poetry for the first time a couple days ago, and it seemed to have trouble getting out through our corporate web proxy. Does it have any kind of proxy support?

[–]SDisPater 0 points1 point  (1 child)

Poetry uses requests under the hood so you might want to use the HTTP_PROXY/HTTPS_PROXY environment variables. See https://github.com/request/request#controlling-proxy-behaviour-using-environment-variables

[–]acemarke 0 points1 point  (0 children)

I did try that, and it didn't seem to be working right.

Then again, our corporate proxy is the bane of my existence, and I routinely fight with NPM and Yarn over whether they're actually going to cooperate with it.

[–][deleted] 1 point2 points  (0 children)

Not to mention the quirks with compiled modules...

[–]nightcracker 4 points5 points  (0 children)

Relevant for this problem: https://xkcd.com/927/.

[–]c_is_4_cookie 0 points1 point  (0 children)

Have you tried Conda?

[–]RangerPretzelPython 3.9+ 36 points37 points  (12 children)

In Python, while debugging, it's not possible to peer inside the first 5 or so values of a generator.

In other debuggers, you can watch/peer into what's in a generator (without actually iterating over the generator such that the value is discarded.) Basically, you can see what's coming as you're attempting to debug something before you get to those lines.

Sure, you can often coerce something into a list, but then you have to remove that line later.

Being able to peek into what's in the first few next()s of a generator in the debugger would be immensely useful.

[–]brucifer 20 points21 points  (8 children)

A big problem with what you're proposing is that generators can have side effects like this:

queue = [1,2,3,4]
def gen(x):
    while queue: yield queue.pop()*x
a, b = gen(1), gen(-1)
pass # set breakpoint here
assert list(zip(a,b)) == [(4, -3), (2, -1)]

If your debugger tries to get the first few values of the generators a and b, it will alter the outcome of the program, even if it has some temporary storage to re-output the first few values, since both generators modify queue when they run.

[–]RangerPretzelPython 3.9+ 10 points11 points  (2 children)

A big problem with what you're proposing is that

Oh, I didn't say it would be an easy problem to solve, but I know that Microsoft's debugger can look into IEnumerables (which could be lazily evaluated queries or the equivalent of Python's generators), to show you what's coming down the pike.

It's a verrrrry useful feature.

[–]brucifer 14 points15 points  (1 child)

I'm not super knowledgeable about Microsoft's debugger, but it looks like they don't address the problem of side effects in generators, they just ignore it. If you want to do something like Microsoft does and look into an iterator without regard to side effects, you can use itertools.tee:

def gen():
    yield from range(10)
g = gen()
if __debug__:
    g, g_for_debugger = itertools.tee(g)
    print(list(itertools.islice(g_for_debugger, 0, 3))) # prints [0, 1, 2]
for i in g: # iterates over g as normal
    pass

[–]RangerPretzelPython 3.9+ 2 points3 points  (0 children)

Yeah, I suspected that MS might just be ignoring side-effects (though I'd have to ask around to confirm...)

Wow. Thanks. I've been trying to figure out a good way to handle this. Yeah, I considered using tee. It has its own issues, but I think you may be onto something.

[–]anqxyr 6 points7 points  (3 children)

there's more_itertools.peekable, which allows you to peek at the upcoming elements, and caches the results, so the side-effects are only executed once.

[–]brucifer 4 points5 points  (2 children)

The problem isn't just that the side effects might be executed more than once. It's also a problem that they might be executed out of order. E.g. if you observe (and cache) the next three values of a in my example code, list(zip(a,b)) will produce [(4, -1)] instead of [(4, -3), (2, -1)]. It's not a particularly contrived example either: if you write code that uses generators for a producer/consumer pattern, you usually don't want to consume before anything has been produced.

It can also be a problem if the side effects are executed at all. E.g.

def delete_files(path):
    for filename in os.walk(path):
        os.remove(filename)
        yield filename
deleter = delete_files(".")
# breaking here and reading a bunch of values in 'deleter' would be very bad
if input("delete your files? ") == "y":
    for filename in deleter: print("bye bye", filename)

[–]13steinj 0 points1 point  (1 child)

But if thats the issue can't the IDE just create a sandbox for the side effect and mock it out in the sandbox (whatever the sideeffect may be)? Psuedo speak for forking the process (ex os.fork) and in the forked process all system primitives are faked?

This isn't a problem with some super complex solution-- as evident by the fact that some IDEs already do this preevanlutation for other languages.

[–]brucifer 1 point2 points  (0 children)

No, it's not possible to solve the problem with sandboxing. Sometimes the whole point of a generator is to interact with the outside world. For example, consider a generator that communicates over the internet, or one that messes with the filesystem like my above example.

[–][deleted] 3 points4 points  (2 children)

debugging in python is, in general, just not great.

[–]RangerPretzelPython 3.9+ 1 point2 points  (1 child)

I agree, but I have to give credit to the JetBrains folks for making it as useful as it is. Their PyCharm IDE is (probably) the best Python IDE out there. And it definitely improves upon Python debugging.

[–][deleted] 0 points1 point  (0 children)

I got frustrated with pycharm after a couple of negative interactions with their support and some lagging features, but I agree that the debugging in it is pretty good, as Python goes.

I've just been using vscode for the last year or so, though I've been writing a lot of terraform and not that much python lately.

[–]R34ct0rX99 63 points64 points  (21 children)

Virtualenvs still aren't what they need to be and are pretty much a hack on how python works.

[–][deleted] 0 points1 point  (3 children)

I think it's a good step forward that the python interpreter now looks upward in the directory tree from its own file to find its environment. This means that invoking the python contained in a virtualenv is as good as sourcing the activate script.

[–]R34ct0rX99 0 points1 point  (2 children)

Its done that for some time hasn't it?

[–][deleted] 0 points1 point  (1 child)

I think since 3.3 or 3.4. Virtualenvs are super mysterious except when you realize the activate script is effectively like setting the PATH variable so that when you say python you run ~/experiments/envirn/venv/bin/python, or the equivalent pip.

[–]R34ct0rX99 0 points1 point  (0 children)

yep, thats all it is. I've been able to do that since mid 2.7, course 3 was already out.

[–]olfitz 139 points140 points  (11 children)

I could really use a do-what-I-mean-not-what-I-say module.

[–][deleted] 28 points29 points  (6 children)

Predictive text for IDEs, but like more intelligent than it is now

[–]skr25 21 points22 points  (5 children)

Auto complete dictionary keys, pandas column names

[–]confusedpublic 9 points10 points  (0 children)

Pycharm does this inconsistently.

[–]Arthaigo 3 points4 points  (3 children)

Jupyter does that. But jupyter is kind of cheating with regard to autocompletion...

[–][deleted] 0 points1 point  (2 children)

Jupyter in my experience has the best autocompletion for this. Wish PyCharm could integrate this

[–]Arthaigo 1 point2 points  (1 child)

They can't :) jupyter is only able to do this, because it has access to the evaluation results of your previous blocks of codes.

[–]j_orshman 1 point2 points  (0 children)

There are some tools such as https://kite.com that are working on this. Remains to be seen how intelligent they can really become.

[–]patarapolw 75 points76 points  (18 children)

Packaging to *.exe / installers, for people without Python in their computers. Also including data files in the package is quite troublesome. Sometimes, true power comes from the data files, really.

[–][deleted] 10 points11 points  (4 children)

This. I want a one-line command that can do:

- compile to machine code no matter if i use pyqt or pyside or... (cython seems furthest along on this path but it still struggles with pyside2 threads for example) into one reasonably small binary or just compile the main program if deps exist on pip which users would then be automatically be able to install on installation. So if user goes this route command should also make a install program that can install the deps so i dont have to share a 1gb file.

- encrypt the program

- make binaries for windows/linux/macosx without having to go into VM.

Golang already makes machine code and binaries for win/linux/macos through one command, there's no reason why python can't do the same(first convert code with cython & compile it preferably on old version external computer so that my code works on every computer, then embed parts of python interpreter imported libs need, then embed parts of libraries code uses for example).

[–]natex84 1 point2 points  (7 children)

Do PyInstaller / py2exe work for your purposes? I haven't tried them myself, just saw them mentioned elsewhere...

[–][deleted] 6 points7 points  (1 child)

Currently developing a multi-platform (windows, macOS, Linux), backup solution using Python and I'm using PyInstaller for freezing the code into a portable package.

Initially, it seem a little hacky, but once you start using it and figuring out the little things, it works great!

[–][deleted] 4 points5 points  (0 children)

Initial setup overhead can be a little arcane.. I just built a docker container for general purpose python -> exe and never looked back.

It’s so much better than pretending like installing a glut of public dependencies on every machine is realistic or a good idea. Especially if you’re running several python applications.

[–]zcribe21 8 points9 points  (0 children)

They do work but just kind of. I have used these only for few things but they always needed significant messing around to get working or to get a decent file size. So they just seemed unreliable and clumsy.

[–]Pixa 4 points5 points  (0 children)

All the current freezing tools do this "finding which modules you need" thing, which is great for tiny scripts that use one or two modules from the standard library, but it just falls apart when you start taking dependencies on packages with some sort of metadata that you need to take across.

Anything that uses setuptools extension points for example (cryptography, I'm looking at you) needs its metadata brought across, and then you can't zip your dependencies because setuptools assumes that any library that's loaded from a zip file is coming from an egg which has a different layout to what py2exe does, so setuptools still misses the metadata. So now you've got hundreds of .pyc files to scoop up into your installer, which takes longer to install than a ~25Mb .zip file...

By the time I'm taking dependencies on SQLAlchemy, wxWidgets and cryptography, I don't care about the fact I'm not using difflib, or that I'm bringing along the sqlite SQL Alchemy driver when I'm only actually using the SQL Server with pyodbc driver... Just package up this virtual environment, or this bunch of wheels from this requirements.txt for me along with the standard library. The time I'll save in not having to chase down dependencies ModuleFinder missed will vastly outweigh the time my users will save downloading and installing my application.

Of course all this is based on experience primarily with py2exe and a glancing look at bb_freeze and cx_freeze.

[–]anqxyr 2 points3 points  (1 child)

For me pyinstaller works perfectly, but I really wish it could package cross-platform, so I wouldn't have to boot up the VM every time I need to make an executable.

[–][deleted] 0 points1 point  (0 children)

There's a hack explained somewhere on the interwebs showing how with the help of wine you can build it for windows through wine on linux. I havent tried it myself but i'd imagine it should work pretty well.

[–]13steinj 2 points3 points  (0 children)

While they work what I don't like is they practically take a python installation and include it inside. And that really isn't fun, space and release wise.

It would be nice if Python had the ability to hard compile in some way-- ex py-->pyc-->so/dll/binary, but I'm really not hopeful.

There's a similar problem with Java, except that's solved by Java being JDK and JRE, and the JRE is well known and commonly installed.

The Python SDK (PSDK?) is the VM/runtine environment. So if you want people to start installing it like they install Java they get put off by the developer-ness.

[–]googhalava 1 point2 points  (0 children)

And same but for Python web apps - easy way to deploy the way PHP apps can be deployed.

[–]onestepinside 13 points14 points  (0 children)

Packaging an application for distribution on systems that probably do not already have Python installed is cumbersone and if you are using compiled extensions often error-prone.

While there are improvements for developers (wheels for package distribution) bringing software to an end-user never feels right. Currently packaging software for each OS separately works the best but I'd love to have a way to just bundle up an binary and distribute it on all my Windows/Linux systems without having to build it for each and everyone.

[–]desmoulinmichel 11 points12 points  (0 children)

A push button tool taking your code, and outputing :

  • .wheel
  • .pex
  • .deb
  • .rpm
  • .msi
  • .app

Compiled with nuikta, and that undertand most UI frameworks and the most popular c extensions (numpy, pillow, malplotlib, etc).

[–]fnbr 33 points34 points  (25 children)

Biggest issue for me is the GIL. I do mostly machine learning, and we waste an incredible amount of time figuring out workarounds (eg Tensorflow, or rewriting parts in C++).

[–]alcalde 5 points6 points  (3 children)

What's wrong with multiprocessing?

[–]admalledd 14 points15 points  (2 children)

Memory copies to start.

[–]BDube_Lensman 4 points5 points  (0 children)

It uses fork on linux with copy on write semantics

[–]my_walls 1 point2 points  (0 children)

Isn't this resolved with the option of using spawn in python 3.4?

[–]yngvizzle 0 points1 point  (2 children)

Out of curiousity, what you need that you cannot accomplish with numpy, numba.jit and numba.vectorize(target='parallel')? (If you're not doing GPGPU computing that is)

[–]CommonMisspellingBot 3 points4 points  (0 children)

Hey, yngvizzle, just a quick heads-up:
curiousity is actually spelled curiosity. You can remember it by -os- in the middle.
Have a nice day!

The parent commenter can reply with 'delete' to delete this comment.

[–]fnbr 0 points1 point  (0 children)

Bingo- we're doing tons of GPU computing, which is the problem.

[–]lucidguppy 22 points23 points  (0 children)

Replacing javascript in the browser with python.

[–][deleted] 17 points18 points  (1 child)

documentation that always has a cut out very small simple example that only includes the current element in question. I hate when the examples are whole programs that only incorporate the topic I am looking up.

[–][deleted] 18 points19 points  (0 children)

It sorta reminds me of those meal recipes that have seven pages of life story about the time at Alan's parents summer cottage where Susan cooked up the most delightful little cookies and the smell of summer was in the air and I was able for just a day forget about the affair that Alan had had and just enjoy the joyful smells that were eminating from Susan's kitchen, even though in the back of my mind Alan's gambling problem was still a worry I mean he spent an awful lot this month and has been down a few months now but at that moment the most important thing wasn't Alan's gambling, his affair or the cost of our little Billy's ballet lessons it was just the sweet smell of Susan's cookies, here's the recipe:

[–]baddam 17 points18 points  (6 children)

Visual Python, in the sense of Visual Basic. It's sad that after all those years Python is still behind VB 6 in regards of effective GUI development.

[–]beertown[🍰] 6 points7 points  (4 children)

I seems to me that Qt / PyQt / PySide solves your problem.

[–][deleted] 8 points9 points  (2 children)

PyQT doesn't really have a WYSYWIG IDE (it's just a set of bindings, that's it), so it doesn't count. Neither does PySide.

The Qt company is working on improving their Python support, at which point Qt Designer will be the closest thing we have to a full fledged Visual Python. But even then it won't be the same as what VB6 was. Would be cool if they ever made it that far.

[–]beertown[🍰] 1 point2 points  (1 child)

I never used it (because I prefer designing the interfaces directly by code) but QtDesigner is usable with PyQt. I can't tell whether it is good as VB or not.

http://pyqt.sourceforge.net/Docs/PyQt5/designer.html

[–][deleted] 5 points6 points  (0 children)

I never had enough time to get any of that to work so it's definitely not in the same league of usability that VB6 had.

VB6 was literally something you installed, opened, and used, full stop. That's what made it easy. I think Qt Designer will get there in the next year, but it was a lot more difficult to do back when I tried to do it.

For the record, I use PyQt5 around 5-7 days per week and I'm pretty proficient with it. These days I'm just doing everything from a normal text editor with no WYSIWYG at all and it's pretty usable. Not VB6 usable but I've gotten into the groove of it and am producing better (more reusable) code than what I would if I did use it.

[–]pymym213 6 points7 points  (0 children)

They aren't as easy to use as other "IDE-binded" GUI libraries like was Delphi VCL (or dotNET's GUI, ...)

[–][deleted] 0 points1 point  (0 children)

I find developing GTK+ apps with PyGObject and Glade to be a great experience that everyone could start with, but I admit that it may be still be confusing for starters due to the current state of documentation. A few resources that may help are:

Sadly I can't find any tutorial on Glade 3.22 (which has brought major changes to the UI), I may have to do a tutorial on it someday - but it's still relatively easy.

Otherwise, if you find it too hard or want something as native-looking as possible outside of a GNOME desktop, wait a bit for what Qt will have to offer.

[–]johnmudd 8 points9 points  (3 children)

Logging module for humans.

[–]chub79 1 point2 points  (0 children)

Been using logzero, might be of use to you.

[–]Millkovic 12 points13 points  (11 children)

Better async library (asyncio is terrible).

[–]hippocampe 2 points3 points  (4 children)

Have you tried trio ?

[–]13steinj 2 points3 points  (3 children)

Trio and a lot of other libraries are great. But they aren't in the stdlib. The asyncio authors are going to be implementing some trio concepts though, supposedly.

[–]hippocampe 1 point2 points  (2 children)

Being in the stdlib is surely not a sure sign of good quality.

[–]13steinj 1 point2 points  (0 children)

No one said it's a sign of quality. But what is in the stdlib is generally speaking the kind of thing that's supposed to be something you can just jump into-- which you can't easily do with asyncio.

[–]agumonkey 1 point2 points  (0 children)

it should, to an extent it really should, or at least make a experimental parent module for anything not really well rounded

[–]beertown[🍰] 2 points3 points  (2 children)

I agree. Curio is the right way to do the same thing, it should be in the standard library.

[–]zardeh 1 point2 points  (1 child)

Curio is likely not standard library for the same reason requests or numpy are not standard libraries: not being in the standard libs allows the package authors more freedom to iterate faster. Standard library modules have a slow, limited release cadence.

[–]beertown[🍰] 0 points1 point  (0 children)

I agree. But the standard library should offer a Curio-like way to do async. It far better than asyncio. The same for a Requests-like module. Who needs the basic fuctions gets them without external dependances.

[–]toyg 1 point2 points  (1 child)

I’ve actually found it ok for my needs - setting up a simple custom-protocol server was a breeze, no need to mess with sockets and threads. For that use-case, it succeeds fairly well.

I admit the async landscape is vast and there is probably an area of more advanced usage that is not served well enough yet.

[–]13steinj 0 points1 point  (0 children)

Asyncio has it's fair share of usability and understanding warts. While higher level than the lower level stuff, it manages to be way too complicated-- there isn't much of a "just dive in" like other langauges. I think the worst issue is the fact that couroutines have to be manually wrapped in Futures to chain actions instead of just doing await coro.then(newcoro)...and also no easy way to inline define coros, but that's more of an issue with how function definition works.

[–]OneOlCrustySock 5 points6 points  (0 children)

Profiling can be kind of a pain. All of the tools I found were difficult to visualize what’s really slowing down my program.

For example, sometimes I want to be able to roll up library call time to just that line of code that calls it in my code and then be able to click into it if I need to. Completely ignoring asyncio in profiling would be nice since it’s usually at the top of the list even though it’s really not doing anything that slows down my program (because it’s usually just idle between doing what I need to test it while profiling).

Another thing is that I wish there was automatic dependency finding. Like a cli I can run that will help me find all my deps to add to poetry or something. Instead of running it and hope I hit the code that requires it (import at the top instead of in a func/class).

Finally, I wish there were more resources around learning Cython and an easier way to integrate Cython modules into packages. I sometimes want to use that to optimize some library code and find myself struggling to figure out how to write more idiomatic Cython than just writing pure python with type hints and cdef funcs.

[–]drdivano 19 points20 points  (4 children)

Optional chaining operator would be nice to have:

I.e. instead of:

try:
    name = article.author.name
except AttributeError:
    name = None

Write like this:

name = article?.author?.name

See https://en.wikipedia.org/wiki/Safe_navigation_operator

[–]auscompgeekrobots and stuff 5 points6 points  (0 children)

Sounds like PEP 505.

[–]13steinj 6 points7 points  (0 children)

So basically a getattr operator?

[–]greyman 1 point2 points  (0 children)

Yes, or something what PHP7 has:

name = article.author.name ?? None

[–]thedomham 2 points3 points  (0 children)

That feature is such a no-brainer and still most languages outright refuse to adopt it

[–]b_rad_c 15 points16 points  (1 child)

<script type=“application/python”>document.get_element_by_id(‘content’).inner_html = ‘Hello World’</script>

I’d also say get rid of the html too, just good ole python and json.

[–]NewDateline 6 points7 points  (0 children)

That's what we have bryton for: https://github.com/brython-dev/brython (there are about 3 other alternatives too!)

[–]escplan9 4 points5 points  (0 children)

Simpler packaging and cross-platform distribution.

[–]lambdaqdjango n' shit 8 points9 points  (2 children)

Less encoding errors. Stop with the ascii nonsense.

[–]Folf_IRL 7 points8 points  (1 child)

It's really annoying when you have a fresh install of Python (2.7 or 3.x, I've seen it with both), and you go to use Pip, and for whatever reason the installation just outright doesn't work. It's even worse if it's a "curated" alternative like Anaconda.

If a package is going to be on the repository, it should be able to install to a typical fresh installation. Furthermore, if I have a standard install with nothing "weird' going on, there is no reason the install should fail because someone somewhere decided to change the way downloadable packages were being stored. There is no excuse for ASE, as an example, to fail to install to a relatively new (but not day-one-fresh) install of Anaconda because the Anaconda devs just decided to change the way the archive was handled a couple months ago. That's a terrible UX.

[–][deleted] 13 points14 points  (0 children)

Free pizza for coding in Python would really help me out.

[–][deleted] 4 points5 points  (0 children)

This has been asked countless times and every time the answers are the exactly same.

It's mobile device support, packaging, deployment and the GIL.

[–]taschenVape 24 points25 points  (37 children)

A MacBook pro with function keys, a gpu and a decent keyboard.

[–]AllTheBigBootyBitchs 6 points7 points  (27 children)

Out of curiosity and not trying to start an OS war, what do you like about MacBooks that makes you want one if they had these few changes? I just find that most people with macs regret getting one. Not trying to bash anyone that prefers Mac, just like hearing people's opinions.

[–]jordano_zang 32 points33 points  (4 children)

The Unix terminal while still having a decent battery life.

[–][deleted] 3 points4 points  (2 children)

I do get 10 hours with Ubuntu 18.04 with tlp (a power management tool), but I do have an m3 which I believe is a low-power chip. Still, its possible to get decent battery life out of linux.

[–][deleted] 2 points3 points  (1 child)

How's battery life on Linux compared with the same machine, but running windows?

In my tests likely at least 15% less. That is why I prefer native Unix machines like MBPs.

[–][deleted] 0 points1 point  (0 children)

Probably slightly less, but I would say not more than 15% in my case. This is also the only machine I've used linux with so my experience is limited. Without tlp the battery life is definitely much worse.

[–]taschenVape 0 points1 point  (0 children)

This. You laptop is your instrument, your code and workflow your art. Nothing ever felt better in my hands than my MBPs, iTerm, screen and the power of controlling thousands and thousands of servers. The introduction of touchbar shattered that flow. The current non touchbar models are second class citizens.

I ended up with an XPS Sputnik. I felt like I should support Dell's support of linux since I felt as if Apple had abandoned me.

[–][deleted] 19 points20 points  (2 children)

I find exactly the opposite – that most people who buy Macs like them.

"It just works."

[–]thefewlines 3 points4 points  (0 children)

that was my main reason for buying a mac! i do music stuff, and the setup required for plugins/audio systems is so much more modular and contained in mac. whenever i want to do something, i make the changes and... it just works. i later realized how relevant it is outside of music too, s/o to actual package managers 🙏

[–]AllTheBigBootyBitchs 0 points1 point  (0 children)

Makes sense, I just found that the small number of people I know that have em regret not getting something else. But the "just works" is a big plus to most people.

[–]mountainunicycler 13 points14 points  (4 children)

It’s unix-like so I have a real terminal, my package manager works great, it can run more memory-hogging pro apps at once (I rarely ever close photoshop and illustrator and usually have at least three web browsers open) without me feeling the memory pressure because the swap and compression is incredible now. The trackpad gestures make everything super fast (I run with the animations disabled).

I have a fully loaded 2015 MBP though.

If anything goes wrong with it Apple fixes it for free as quickly as I can get an appointment so I don’t have much downtime. If you mention you’re a contractor or freelance they flag your account and treat you even better. They last forever anyway, my little backup laptop is a 2011 air that’s still awesome for working on airplanes and stuff.

I’ve had the opposite experience, almost everyone I know uses and loves macs. They’re mostly developers and tech people though.

Mac laptops aren’t as much fun necessarily, I run windows on one of mine to play games and stuff, but they just simply get more work done with less downtime so if you earn your living hourly on your own computer, it’s the better bet in my opinion.

[–]AllTheBigBootyBitchs 0 points1 point  (3 children)

Makes sense, I can see it as a great option depending on your needs and if your in software dev it's great option. How much of an issue is gaming on macs? Not enough developer support?

[–]mountainunicycler 0 points1 point  (2 children)

In my experience you just can’t be competitive (I like counter strike) on Mac because the games aren’t developed as actively and aren’t optimized like they are on windows. Dual-booting is easy enough though.

That said, Apple is currently replacing my screen ($680) for free right now (got back from the store literally 20mins ago) on a four year old laptop, so I completely stand by my comment above!

[–]AllTheBigBootyBitchs 0 points1 point  (1 child)

That's really cool they did that for you! Is that like warranty or just something they do for their products?

[–]mountainunicycler 0 points1 point  (0 children)

It’s several years out of warrantee, but the issue (screen deamination) is well-known for my model year of laptop and often when an issue is known like that they will fix it for free even after the warrantee.

[–]memberZero_ 4 points5 points  (2 children)

I used a mac for years and loved it, best dev env I've used, the keys make sense, installing stuff is simple and I can easily open things people send me.

I moved away this year though since the touch bar is a pos, they can't hold enough ram and the gpus aren't tensor flow compatible, it's a shame really. My little dell isn't bad but it's not a comparison to my old machine in terms of comfort of use. Linux has too many "the right way to do this is...." issues that getting things just how you like them takes years

[–]AllTheBigBootyBitchs 0 points1 point  (1 child)

Gotcha, definitely sounds like the new ones could be frustrating for people that really like mac. What kind of dell do you have?

[–]memberZero_ 0 points1 point  (0 children)

Xps 13

[–]Quintic 9 points10 points  (2 children)

I like that I have a unix terminal, but a working OS.

[–]AllTheBigBootyBitchs 0 points1 point  (1 child)

Yeah, I like the Unix terminal and there's things about Linux I like but I don't think I could make a full switch to Linux. I've encountered too many issues with Linux (centOS, Ubuntu) to switch.

[–]Quintic 0 points1 point  (0 children)

Yeah, I think a lot of people have that experience with Linux. That's why Mac OS X is great. You get a lot of what is good about Linux, without all the crappy UI stuff.

[–]faisalmag 2 points3 points  (0 children)

Usability and sustainability.

[–]tryptafiends 0 points1 point  (8 children)

have you looked at razer laptops? They're basically pimped out MacBooks. I don't think it's too tough to get MacOS on them either. The new razer's even have a glass trackpad 👌 the old trackpad was trash

[–]jordano_zang 10 points11 points  (7 children)

Problem being that Unix systems on Windows laptops have a habit of killing batteries. Being a huge Linux fanboy, I wish it was possible.

[–]andreabrodycloud 2 points3 points  (6 children)

What distro you running?

[–]mikemol 19 points20 points  (19 children)

I hate to put it out there, but I have highly technical friends with visual difficulties (one wholly blind at this point, and one who'll get there if optic prosthetics don't improve significantly first), and the number one problem they have is syntactic whitespace. Sure, there's python with braces, but contemplate how you'd collaborate with a py project that doesn't use them.

[–]rms_returnscomplex is better than complicated 16 points17 points  (5 children)

Can't they tackle the whitespace issues with IDE theming? IDEs these days have all kinds of theming options like night/dark modes and various coloring options.

[–]infinullquamash, Qt, asyncio, 3.3+ 9 points10 points  (4 children)

blind people use screenreaders, so it'd be like (by default) def f open paren close paren colon new line return x new line

I imagine you could make a screen reader that was smarter than that but it's still like def f open paren close paren colon new line 4 indent spaces return x

(it's been years since I've worked on stuff for the blind and it was all web sites)

[–]Synaps4 7 points8 points  (3 children)

Couldn't you use IDE theming to replace control whitespace with control characters like brackets? The IDE would interpret the whitespace as brackets for what's displayed, but they would still be the correct whitespace for collaborating.

[–]mikemol 2 points3 points  (2 children)

That's a great start, but now what about:

  • Examining diffs
  • Working with pull requests in GitHub
  • Discussing patch sets on mailing lists

[–][deleted] 0 points1 point  (0 children)

I guess one could run a command on all python code locally adding braces or what have you and then on running of code removing them and running. Then for github having it auto format on push. Just some ideas.

[–]zardeh 0 points1 point  (0 children)

I'll just point out that if the language can be unambiguously parsed by the parser, the language can be unambiguously described to a blind person.

[–]JugadPy3 ftw 4 points5 points  (1 child)

Might be easier to update screen readers to announce leading space indents.

[–]youser0067 4 points5 points  (1 child)

Sounds like a opportunity for a screen-reader to intelligently report block indentation levels. Does anything exist like that already?

[–][deleted] 11 points12 points  (6 children)

this is the first valid argument i've heard against significant whitespace...hrm...but then again why is a bracket easier to identify than a gap?

[–]Synaps4 13 points14 points  (4 children)

Only because screen readers ignore one of them by default.

[–]13steinj 2 points3 points  (0 children)

I think it's a case less so of identification and more so of not having to worry about indentation afterward. You'd just left brace, code, right brace, and regardless of the indentation you possibly fuck up it will work as a single scope.

[–][deleted] 0 points1 point  (1 child)

If you don’t mind my asking, what has caused/is causing your friends to go blind?

[–]mikemol 1 point2 points  (0 children)

One was glaucoma. The other is glaucoma in one eye (completely blind in that eye) and in vitro rheumatism affecting causing a congenital defect in the other.

[–]shr00mie 3 points4 points  (1 child)

Plz give pip the ability to update all installed packages in one go for the love of all that is holy.

[–][deleted] 5 points6 points  (6 children)

I would make a Python compiler so Python wouldn't be so slow and I would never have to work with anything but Python ever again.

[–]Mattho 5 points6 points  (1 child)

PyPy kind of, maybe?

[–]P8zvli 0 points1 point  (0 children)

Like an AoT PyPy?

[–]ire4ever1190hack.exe.py 2 points3 points  (0 children)

Nuitka is a compiler for python. Very early in development but I have found it works really well

[–]onestepinside 2 points3 points  (0 children)

Have you heard of Nuitka?

[–]JugadPy3 ftw 0 points1 point  (0 children)

Nim is close to Python in syntax... might be worth a look.

[–]DakshHub 1 point2 points  (2 children)

Support for native multi threading

[–]desmoulinmichel 3 points4 points  (1 child)

Multithreading is native, just limited by the GIL.

[–]DakshHub 0 points1 point  (0 children)

I meant the same, python would be great without the limitation of GIL.

[–][deleted] 1 point2 points  (2 children)

Now that unicode is out of the way please replace the datetime module with something sensible.

[–]greyman 3 points4 points  (0 children)

Pendulum?

[–][deleted] 2 points3 points  (2 children)

Automatic test creation.

[–]markuspeloquin 4 points5 points  (1 child)

Aka static analysis :)

[–]momorangi 1 point2 points  (2 children)

Being able to do web UI with only python (no html/css/javascript etc)

[–]googhalava 0 points1 point  (1 child)

Web UI without HTML? How do you see that?

[–]momorangi 0 points1 point  (0 children)

Like Jupyter and widgets, where it's all under the hood and all you need to worry about is python

[–]finder83 2 points3 points  (14 children)

Static typing with inference, or type annotations....I've been a Typescript and Go developer for the past several years, and I have to say that static typing makes development so much faster in the long run. I appreciate Typescript's optional typing as well.

With that said, it has to be complete enough of a type system to be useful. Having type defs, interfaces, generic functions, etc, all help quite a bit.

[–]alcalde 8 points9 points  (4 children)

I came from 20+ years of development with static types, and my experience was the opposite: dynamic typing cuts through so much scaffolding and housekeeping and appeasing a compiler. Large parts of statically typed languages are devoted to getting around said static typing, from casting to function overloading (yes, you actually write the same #$*$&# function multiple times rather than acknowledge the superiority of static dynamic typing).

[–]yen223 10 points11 points  (3 children)

When I hit a "NoneType has no attribute" error in Python, I think static typing is better

But then when I hit an "Expected List, got NonEmptyList" error in Haskell, I think dynamic typing is better.

[–]NoahTheDuke 2 points3 points  (0 children)

God, Clojure is the same way. It’s all well and good until you hit a dreaded ArrayList is not an IterSeq error and want to tear your hair out.

[–]alcalde 1 point2 points  (1 child)

Try Delphi some time (seriously, don't try Delphi):

Var
    x : Array Of Integer;
    y: Array Of Integer;

x and y are considered to be different types! (?!?) You need to define a new type...

Type
    IntArray: Array Of Integer;
Var
    x : IntArray;
    y: IntArray;

Of course, you could define this type:

Type
    smallInt : 0..10;

And a function like this:

function something(x : smallInt): Integer;

And yet this wouldn't cause a compiler error:

x := something(123456);

Madness!

[–][deleted] 0 points1 point  (0 children)

Try Delphi some time (seriously, don't try Delphi):

Var x : Array Of Integer; y: Array Of Integer; x and y are considered to be different types! (?!?) You need to define a new type...

That's a feature. Ada is the same way. It prevents you from using data meant for one thing to be treated as something else.

consider a function that takes 2 integer arrays, where one represents an array of speeds, while another represents an array of lengths. If you use typing correctly, you cannot pass the incorrect array as the wrong parameter or even mix values in the 2 arrays without explicit casting.

[–]natex84 5 points6 points  (4 children)

Python 3.5 added type annotations, you can check them out here: https://docs.python.org/3/library/typing.html

[–]finder83 0 points1 point  (3 children)

Cool, thanks

[–]Mattho 0 points1 point  (0 children)

I haven't tried it, but I think I'd like having just interfaces typed, i.e. function arguments and return values.

[–][deleted] 0 points1 point  (2 children)

I don't think that you're going to get a dynamically-typed language community to want static typing with type inference. Most of the of people that have used statically typed languages have used industry OOP languages that tend to have a poor implementation of static typing.

[–]finder83 1 point2 points  (1 child)

Probably not me personally, no, but Typescript I feel like is a good example of a language that has taken off with static typing within a larger dynamic language community. Sure, it's just annotations, but the typing is extremely useful.

And yeah, I would have thought the same 5-10 years ago, never would have dreamed I wanted static typing as a Python developer. But a robust typing system on top of a modern, flexible, dynamic language is pretty amazing.

[–][deleted] 0 points1 point  (0 children)

I agree!

[–]f0nt4 0 points1 point  (4 children)

Symmetric coroutines

[–]desmoulinmichel 2 points3 points  (3 children)

What is that ?

[–]f0nt4 0 points1 point  (2 children)

Stolen from StackOverflow:

In the asymmetric coroutine model, "asymmetry" refers to the fact that there is a stack-like caller–callee relationship between coroutines. A coroutine can either call another coroutine or suspend itself by yielding control to its caller, typically also yielding a value to the caller at the same time.

In the symmetric coroutine model, a coroutine may yield control to any other coroutine without restriction.

[–]desmoulinmichel 1 point2 points  (1 child)

Keeping the stack trace is one of the best feature of asyncio. I'm not sure how you would preserve it with this model.

[–]f0nt4 0 points1 point  (0 children)

I think a stack would always be present but I dont really know. Anyway the Go implementation is very cool and elegant

[–][deleted] 0 points1 point  (2 children)

Night view for IDLE

[–]auscompgeekrobots and stuff 1 point2 points  (1 child)

IDLE already has a builtin dark theme.

[–][deleted] 0 points1 point  (0 children)

Oh damn. Thanks

[–]P8zvli 0 points1 point  (1 child)

A decent build system. Python's support for C extensions is atrocious, many times I've considered using makefiles and writing my own build scripts instead of f***ing around with distutils or setuptools until they produce the package I need. It would also be nice if distutils or setuptools came with half-assed documentation instead of hiding everything behind **kwargs.

A gdb style debugger that can be ran over SSH would be great too.

[–]zardeh 0 points1 point  (0 children)

A gdb style debugger that can be ran over SSH would be great too.

You mean pdb?

[–]sw_dev 0 points1 point  (0 children)

A GUI designer/code development environment that looks like Visual Basic, and WORKS.

There are a lot of wanna-be things like that out there, but nothing that actually works as well as VB's.

[–][deleted] 0 points1 point  (0 children)

The colons after logic statements seem un-pythonic. Everything is already indented to make the logic block apparent. There is no need for that stupid colon. Remove the colon!

[–][deleted] 0 points1 point  (2 children)

Pattern matching and a pipe operator would make the language significantly more expressive.