Alice in Python projectland
veekaybee.github.io
veekaybee.github.io
It's not the first time I say this, but I think it's crazy how long some package ecosystems live without a "sane" package manager, and how recently those even appeared.
pipenv --python python34Is that recent ?
Probably 7.0.0 or 3.2.9, where current version is 8.2.6: https://github.com/kennethreitz/pipenv/blob/master/HISTORY.t...
Also, I guess --python 3.4 would be the preferred way to do it, seems to work with either versions or executables.
https://docs.pipenv.org/basics.html#specifying-versions-of-p...
I have wasted far too much time wrangling pythons packaging systems. Incompatibilities between pip, setuputils, distutils, virtualenv, eggs, C modules, and wheels I have literally given up. I love and use python but I no longer package it and deploy it for others to consume. Try to package a protobuf3/grpc system these days into a .deb, its a nightmare. Even the grpcio devs use docker containers to build packages because python has such a nightmare of a system.
I'll leave the second reason out for the sake of context
[1]: You put the third party code in /usr/local/lib/pythonX.Y/site-packages.
We knew[1] it was wrong in the 1990s, but /usr/local is a "best practice", and these people who believe "best practices" are more important than solid engineering breed faster.
Camacho for president 2020.
[1] http://www.alice.org [2] https://en.m.wikipedia.org/wiki/Alice_(software)
Can you provide examples of different ecosystems that would compare favorably in your opinion?
It's not enforced by policies, the tooling isn't much more helpful than in any other language, and it is not more mature than any widely used ecosystem. It feels like Haskell libraries just need less changes.
Perhaps the nature of Haskell discourages changes, making the community more stable.
That would be the optimistic view. In reality, `NoneType has no attribute Foo` errors happen in production all the time.
And Python does have static analyzers, including for typing.
Could be because of extra flexibility those types grant you, but it's not about bugs.
Note that if you don’t have if __name__ == '__main__',
the code won’t run anything since the function is
initialized but not executed
Isn't this backwards? That test isn't required to make the code run, it prevents the code from running if the file is imported as a module.You don't even need that. The Files[1] class - which has been in the standard library since at least Java 7 - makes this really easy to do.
[1] https://docs.oracle.com/javase/8/docs/api/java/nio/file/File...
with open('alice.txt') as inp, open('new_alice.txt', 'w') as out:
out.write('\n'.join([line.rstrip().replace('Alice', 'Dora the Explorer') for line in inp]))
The author's point is that Java is verbose and requires a lot of boilerplate, which has benefits and drawbacks. I think her example does a decent job of illustrating that.