5 ms·
> but by removing modules from the standard library, backwards compatibility is being broken. API 101 - there is very little cost to leaving them in, but a hid
by m463 8y ago
> but by removing modules from the standard library, backwards compatibility is being broken.
API 101 - there is very little cost to leaving them in, but a hidden major cost to having them disappear, usually for non-developers.
--
By the way, "batteries included" is one of the BEST features of python.
Have you tried to fix something in your house with a "homeowner's toolkit" which is usually something like a hammer, pliers, 2 screwdrivers, a putty knife and a few more basic tools?
It is REALLY tedious, like writing a C program with a few basic tools like stdio and ctypes.
More languages need "batteries included", maybe like Perl.
I think if the cost of deploying a script is 1, deploying it + a dependency is literally something like 100x. You have to make assumptions about all the environments the script will run in, and they are usually wrong.
- arcticbull 8y ago> By the way, "batteries included" is one of the BEST features of python. None of these libraries need to be nuked from existence as a result of this change. I'd wager they'll move into PyPI modules so that teams relying on them could safely continue to do so. > Have you tried to fix something in your house with a "homeowner's toolkit" which is usually something like a hammer, pliers, 2 screwdrivers, a putty knife and a few more basic tools? It is REALLY tedious, like writing a C program with a few basic tools like stdio and ctypes. That's one extreme, but I don't think that's what's being proposed. The proposed model is closer to what Rust does today, where the core is slim, opening up new potential use cases, and the more complex functionality built on top of it is left to the community to maintain. Take a look over some of the modules they're deprecating, like smtpd. What kind of standard library requires an SMTP daemon built in? That's akin to a homeowners toolkit including a planishing hammer [2] for some reason. > I think if the cost of deploying a script is 1, deploying it + a dependency is literally something like 100x. You have to make assumptions about all the environments the script will run in, and they are usually wrong. Depends on how it's done, honestly. Check out this Rust "scripting" system [1]. It has full support for third-party crates. [1] https://github.com/DanielKeep/cargo-script https://github.com/DanielKeep/cargo-script [2] https://en.wikipedia.org/wiki/Planishing https://en.wikipedia.org/wiki/Planishing
- m463 8y agoSorry, my "batteries included" comment was independent of the changes proposed. I just love the rich library python provides (compared to other scripting languages).
- arcticbull 8y agoI hope you didn't take my reply to be aggressive in any way! Standard library is always a point of contention in any environment and it's always good to explore all angles. It's kind of the ultimate bikeshed in a lot of ways. Python indeed is a very batteries-included language and there's a lot to like about that. I wonder if there's a way of preserving that by differentiating between a 'lite' and 'core' distribution so we can still meet the goals of the embedded / small system community?
- u801e 8y ago> Take a look over some of the modules they're deprecating, like smtpd. What kind of standard library requires an SMTP daemon built in? Just because it's not widely used doesn't mean it cannot be included in the stdlib. For instance, where I work, we have a MTA test framework that makes extensive use of smtpd to receive messages processed by our configured MTA which we then write to disk and subsequently make assertions on the message (e.g., contains certain headers, has certain recipients, etc.). Having various protocols (client and server) in the stdlib is not a bad thing and, personally, I think it's very useful for testing purposes.
- yawaramin 8y agoYou couldn't set up a library dependency on smtpd or similar for your test project?
- kllrnohj 8y ago> API 101 - there is very little cost to leaving them in That's not true as newcomers will typically bias towards bundled modules instead of 3rd party ones. If it's well accepted that the bundled modules are bad in some way then you are encouraging further use of them by leaving them in. That's real cost, and not just on the Python maintainers side of thing.
- m463 8y agoYou can hide them or mark them deprecated in such a way that new scripts don't see them, but old scripts still function.
- CJefferson 8y agoJust how is a beginner, or in fact anyone, supposed to go and choose the "right" 3rd party module, when it seems half the stuff in pip is either half implemented, or even just a hello world example.
- anoncake 8y agoAn official list, containing only one library for each purpose, could solve the issue.
- kllrnohj 8y agoBy simply asking that question you're already more likely to get a better result than if there was a known-wrong choice bundled into the standard library. But really that's just a tutorial/discovery issue, which has many solutions. And not even a skill isolated to programming - how do you pick the "right" item on Amazon to buy?
- gugagore 8y agoC also doesn't have a standard package manager. I think that's the big problem. Built-in functionality is less important if you can easily use packages.
- labster 8y ago> By the way, "batteries included" is one of the BEST features of python. > More languages need "batteries included", maybe like Perl. Agreed with both points, the lack of batteries makes Lua quite annoying for me personally. Python and Perl are much more comfortable because you don't have to hunt down the most common operations. Of course, Perl 6 has decided not ship batteries included, replacing batteries with a fusion reactor instead.
- bigiain 8y ago> Have you tried to fix something in your house with a "homeowner's toolkit" which is usually something like a hammer, pliers, 2 screwdrivers, a putty knife and a few more basic tools? Sure. But did you read the list of proposed deprecations? It's not like that homeowners toolkit becomes any more useful when it's also got a buggy whip tool, a set of special allen-like keys that only open the case of a TRS80 or a Commodore64, and one of those picks for getting stones out of horses feet. Most of the proposed things to take out seem obviously "right" to me. AIFF sound file support? MacOS9 binhex? CGI? _Maybe_people are still using those things, but it seems to me like they're edge-case enough to let them know now that they'll need to do "pip install aifc" or "pip install cgi" sometime after late 2021 if they update their python installation (which they can choose to put off until at least 2024 or so, just like all of us who're still sometimes using Python 2.7...)
- rlayton2 8y agoYeah, I went into the article prepared for a "NO! Leave that in!", but I didn't realise just how much very old cruft was in there.
- c3534l 8y agoThe approval process for getting libraries okayed for production is a massive pain in the ass, and for good reason. Without a batteries included language, it'd be easier to write all those tools in-house than hope that maybe in two months I can get a library out in production, even though it's just JSON parsing or something. The "this is an official part of the language and held to high standards, guaranteed to be suitable for poduction and needing no approval beyond already being approved to use the language" makes Python way more preferable IRL than languages I love, but don't even include a random number generator in the standard library.