Live data from Hacker News

“Python's batteries are leaking”

pyfound.blogspot.com

81–90 of 420 posts

Re: “Python's batteries are leaking”

#81
post #44

Earlier quoted context omitted.

I found that attractive when I first learned Python, but when I (much more recently) started picking up Rust, I was blown away by how easy and normal it is to use external packages: the build tool and package manager are the same thing and shipped with the language, the hello-world-equivalent docs assume you're using it, and even the Rust compiler and standard library themselves can (carefully) depend on external pac…

> Having run up against limits of the Python standard library several times in years of writing production software in it and not just learning it, I find the batteries-not-includes-but-easy-to-install approach better on the whole. Obviously it doesn't apply to everyone, and it certainly doesn't apply to most startups or open source developers, but I spent most of the last 20 years working in environments where you h…

Yes, my own employer is similar (you don't need permission, but production systems have no internet access and so you need to pre-download all your tarballs etc.), and cargo doesn't work right. But I think there is work on pointing cargo at an internal mirror.

We do have an internal PyPI mirror (with devpi) and we point `pip` at that, and it works pretty well.

Re: “Python's batteries are leaking”

#82

Earlier quoted context omitted.

Yea. I'm using Rust at the moment for fun and the amount of things not in the standard library is crazy to me. What? There is no built-in dictionary? What do I use instead and where is it? Edit: based off of all the replies below, everyone understands the validity of what I'm trying to say, but also have fortunately pointed out my admittedly grevious error of not knowing you can just import hashmap from stdlib. The e…

Dictionary in the python sense? There are two! https://doc.rust-lang.org/std/collections/struct.HashMap.htm... https://doc.rust-lang.org/std/collections/struct.BTreeMap.ht...

Oof, I wasted a good hour+ trying to convert from one to the other. Maybe there's an easy way to do this, but not many people on IRC knew (or were available at the time).

Re: “Python's batteries are leaking”

#83
> Brown called out the XML parser and tkinter in particular for making the standard library larger and harder to build, burdening all programmers for the sake of a few

Tkinter needs to go...There is very little reason except for the legacy ones, why it needs to be there still...

Re: “Python's batteries are leaking”

#84
post #18

Earlier quoted context omitted.

You want pyca/cryptography. The last thing in the world you want is a standard crypto library that no experts are enthusiastic about maintaining. Golang had an unfair advantage here, because the language team included cryptography engineers. It would be weird if most languages had the same kind of crypto in their stdlibs. I think there is in general nothing wrong with a language ecosystem where key parts of the whole…

The problem with third-party libraries is that it's impossible to know which ones are "standard" and which ones are copycat hobby projects in various states of disrepair. And in the worst case you can pick a library, get a day or two into using it, and discover it has a show-stopper limitation. I recently hacked together some Python to process MIDI files. Should I have used this: https://pypi.org/project/MIDIUtil/ or…

In a perfect world everything would be in the stdlib, everything would be well-integrated, everything would serve every use case, and everything would be well-maintained by engaged and motivated maintainers.

For some kinds of libraries, you can sacrifice a whole bunch of those constraints and still have it make sense to host it in the stdlib. I'm fine if the JSON library is slow or inflexible if it covers a bunch of use cases and doesn't impede people from writing better ones. You can see this to some extent with the state of "router" HTTP libraries in Go.

But for some things, most notably cryptography, it's worse to have a suboptimal version in the stdlib than to have none at all.

Re: “Python's batteries are leaking”

#85
I may be terribly wrong about this, but I would think that in general if someone makes an improvement to something you make then you would want to integrate that person and their improvement in some way. Treat like any other update: mention it in the version notes and warn about compatibility of code using the previous version. I know that renovation can suck but it's something that we need to be doing. A comprehensive stdlib means that once you've got it, you don't need to worry about being able to access packages along the way - how are you going to download a package if you can't connect to the repository? How much can you trust a third-party dev vs the core team?

If a package is really niche, it may not make sense to put in the integration work. But for a package that is used by a significant majority in a general application - why would you want to keep it separate if it is so much better?

I am ignoring human interaction here - there are probably of dozens of answers to that question if you count personal motivations.

Re: “Python's batteries are leaking”

#86
post #8

Earlier quoted context omitted.

Maybe he’s simply burnt out? The pressure of being in charge of something as big as Python must be intense. People make demands on his time and expect the “benevolent dictator” to cunningly solve everything like a modern day Salomon. I know he gave up the title, but as he personifies Python, I imagine the influx of requests for his attention may not have subsided much.

Was he like that before ? some say he was always balanced even when python3 came out. let's hope everything settles smoothly :)

My only experiences with Guido when he was a Googler were incredibly unpleasant.

(This was years ago, and i don't have the email exchange anymore, so i'm doing my best to describe it from memory)

I reported a bug I had debugged pretty heavily and believed was likely a bug in the appengine datastore (this was before it was publicly available, IIRC), with a fairly detailed repro recipe, etc.

(I was not on the appengine team, just building an app)

I had debugged all the client side code all the way down to the rpc to the datastore server and was positive there was nothing weird going on there at all.

Within a minute or two of me sending the email to the email alias , he replies with "This must be a bug in your code, that can't happen". He didn't even look at it (i looked at the logs)

I replied with "I agree it should be impossible, but if you could look at it for a second, i think you'll see that it's not and is actually happening. The code is very simple, etc".

He says "I don't have time to fix your code".

So i spend the time and reduce it to a simple, 20 line piece of completely obvious code (IIRC i believe it had no real code except to instantiate the class and store it in the datastore) with no dependencies.

and say "here, i took the time to try to make it as clear and obvious that this is really not a bug in the code, because there is no real code here"

He replied with something else abrasive and dismissive.

Then, about 20 minutes later, one of his teammates replies with basically, "oh shit, this is bad".

(Because what i had discovered turned out to have caused data loss that they couldn't automatically fix. The could get the data back from restores, but it wasn't clear what to do with it, you needed intervention from a user)

Honestly, it would have been better for him to not respond at all. (he was not the on-call team member at the time anyway)

We all have our bad days/times of course (i definitely did!), so i do hope he's found more inner peace than he had back then. But yeah.

Re: “Python's batteries are leaking”

#87

> six is non-optional for writing code for Python 2 and 3 I maintain a Python 2 & 3 compatible project that has no external dependencies.

I do similarly as you (maintain 2/3 code without dependencies) but every time I have to do string encoding/decoding it kills me to find a way that half works, and I don't have a ready solution in my mind for these that doesn't break half the time. How do you handle non-ASCII in a compatible manner? Like Unicode stdio? Unicode file paths? Unicode sys.argv? string_escape/unicode_escape? I feel like Python 3 completely wrecked strings instead of making them better.

Re: “Python's batteries are leaking”

#88
post #21

Guido is a good dude, through-and-through, despite his perhaps bad behavior here. Amber is nothing short of an open source hero, having brought Twisted, one of the best open source projects in the world, to new heights. Her insights are as important as anyone in the python community, and after six consecutive PyCons sprinting at the Twisted table (including literally in a chair with Amber to my left and Glyph to my r…

The problem with rants is it stings and it divides. When it comes to constructive criticism, I think Amber did a good job with her criticism but can do better at the constructive front. Her problem statement was spot on and I agree that the direction she proposed is a good one. However, to separate the standard library from the core is probably even more dramatic than the Python 2 to 3 migration. Is that what the com…

Is "embrace PyPI and move things like asyncio there" not a constructive suggestion, or is she sort of being penalized because the most reasonable solution to the problem can be described in less than half a sentence so it's seems like there's more complaint than solution?

Re: “Python's batteries are leaking”

#89
post #61
post #21

Guido is a good dude, through-and-through, despite his perhaps bad behavior here. Amber is nothing short of an open source hero, having brought Twisted, one of the best open source projects in the world, to new heights. Her insights are as important as anyone in the python community, and after six consecutive PyCons sprinting at the Twisted table (including literally in a chair with Amber to my left and Glyph to my r…

Aren't conservatism and minimalism pulling in opposite directions here? Amber wants to remove asyncio from the standard library. That's minimalism but not conservatism.

I think "gracefully correcting mistakes" is in the usual definition of conservatism: political conservatives who say that recently-recognized rights aren't actually rights or who wish to shut down recently-instituted programs that depend on government spending are no less conservative simply because they want a change to the status quo.

Also note that one way of interpreting her proposal is "generalizing the 'ensurepip' model" to keep things already in the standard library in the standard library, but move feature development externally and make it easy to upgrade packages in the standard library. (Then Twisted, which is also installed externally, can simply depend on a fixed version of a standard-library package.)

Re: “Python's batteries are leaking”

#90
post #38

Why is it so difficult to admit Node.js did the package thing right, by keeping a local folder just for the app, isolation from other apps with zero effort?

The node way is certainly not the right way to handle dependencies, but it is laboring with a language that has absolutely zero batteries built in. Micropackages and sprawling dependency trees is a disaster.

I'm cautiously hopeful on the direction that .Net Core is taking, with the major pieces of the old framework modularized as nuget packages.

Post reply on HN