Earlier quoted context omitted.
i mostly agree with those choices. colorsys: a small handful of conversion functions you need every now and then fileinput: quick and dirty boilerplate for when you want to accept input from files or stdin getopt: a fine, well understood command line parser optparse: it's a simpler more broken argparse that will eventually tell you "i'm sorry dave..." and people should stop using it wave: great way to create or proce…
I disagree that optparse is more broken than argparse. As someone who wanted to add some (trivial) features to argparse, I quickly backed away from that code [1]. To be honest, I was really surprised how needlessly complex that particular code is. [1] - https://github.com/python/cpython/blob/main/Lib/argparse.py
Python finally offloads some batteries
41–50 of 67 posts
Re: Python finally offloads some batteries
#42Does anyone actually have normal users run Python programs? I thought programming was intended so that users could run your programs. But if a regular non-programming user wants to use a Python program, they need a whole tutorial on how to install and run it. Put everything in the standard library, or nothing at all, it doesn't really matter. Either way you still have to set up a custom environment and install a bunc…
Not sure what this is really on about, you can easily run a python program opaquely to a user by packaging it as an executable… or simply including #!/usr/bin/env python3 in a shell file and then `chmod +x script.py` on Linux. But to answer your question, yes, millions of people run Python programs without ever knowing anything about Python.
Re: Python finally offloads some batteries
#43Does anyone actually have normal users run Python programs? I thought programming was intended so that users could run your programs. But if a regular non-programming user wants to use a Python program, they need a whole tutorial on how to install and run it. Put everything in the standard library, or nothing at all, it doesn't really matter. Either way you still have to set up a custom environment and install a bunc…
Not sure what this is really on about, you can easily run a python program opaquely to a user by packaging it as an executable… or simply including #!/usr/bin/env python3 in a shell file and then `chmod +x script.py` on Linux. But to answer your question, yes, millions of people run Python programs without ever knowing anything about Python.
Re: Python finally offloads some batteries
#44Does anyone actually have normal users run Python programs? I thought programming was intended so that users could run your programs. But if a regular non-programming user wants to use a Python program, they need a whole tutorial on how to install and run it. Put everything in the standard library, or nothing at all, it doesn't really matter. Either way you still have to set up a custom environment and install a bunc…
Re: Python finally offloads some batteries
#45This is stupid. I use cgi all the time. My cheap Hetzner single core vps can fork a Linux process 10k times a second, so I don't want to hear about forking being too slow until Django can serve pages that fast. Cgi is still the simplest way to get a basic web script running, without worrying about lingering state between page hits, etc. Doesn't Linus always shut down such discussions regarding the Linux kernel with "…
Re: Python finally offloads some batteries
#46Earlier quoted context omitted.
i mostly agree with those choices. colorsys: a small handful of conversion functions you need every now and then fileinput: quick and dirty boilerplate for when you want to accept input from files or stdin getopt: a fine, well understood command line parser optparse: it's a simpler more broken argparse that will eventually tell you "i'm sorry dave..." and people should stop using it wave: great way to create or proce…
I disagree that optparse is more broken than argparse. As someone who wanted to add some (trivial) features to argparse, I quickly backed away from that code [1]. To be honest, I was really surprised how needlessly complex that particular code is. [1] - https://github.com/python/cpython/blob/main/Lib/argparse.py
There has been an open bug for this for many years.
Re: Python finally offloads some batteries
#47Earlier quoted context omitted.
I disagree that optparse is more broken than argparse. As someone who wanted to add some (trivial) features to argparse, I quickly backed away from that code [1]. To be honest, I was really surprised how needlessly complex that particular code is. [1] - https://github.com/python/cpython/blob/main/Lib/argparse.py
Argparse is also broken. It's not possible to create an argument that captures all remaining arguments even though the docs say it is. There has been an open bug for this for many years.
Re: Python finally offloads some batteries
#48Earlier quoted context omitted.
Argparse is also broken. It's not possible to create an argument that captures all remaining arguments even though the docs say it is. There has been an open bug for this for many years.
Link to the bug?
Apparently after 7 years they decided it can't be fixed and updated the docs.
Re: Python finally offloads some batteries
#49Earlier quoted context omitted.
I often wonder how many businesses often need code to operate. Back in school we had a database design class where the prof asked us to design a system for a user base of 50 something users per year. We were all dumbfounded when our react/postgres/python stacks were overkill when the prof explained that pen and paper or excel would’ve sufficed
reminds me of an interview I had a couple days ago where the interviewers wanted me to design an app for a 50 person building. I suggested a monolithic server side web app that serves html with minimal JS and they were expecting load balancers, multiple az, microservices, react, sharded db. lmao
Re: Python finally offloads some batteries
#50Here are some features I miss regularly and I believe should be part of the standard library:
- support for modern compression algorithms (e.g. brotli, zstandard)
- support for modern hashing algorithms (e.g. argon2, bcrypt)
- support for parsing ISO 8601 date times with "Z" as timezone designator
- a TTL-cache implementation (like cachetools offers)
- support for reading/writing YAML