News for hackers. Stuff that matters.
Re:Practical Python Programming by sooheon on Thursday June 18, 2020 @09:01PM (#23569931)
> why people love this language so much

Because no matter what problem you have, after 12 minutes of googling, you can pip install foo. The language almost doesn't matter because most programming is via library api.

Re:Practical Python Programming by jakear on Thursday June 18, 2020 @09:08PM (#23569986)
I can do the same with npm, but if there’s a @types available (or better yet built in), I barely have to read long-form documentation and I get smart completions with documentation, types, etc right in my editor, specific to the exact expression I’m editing.
Re:Practical Python Programming by dragonwriter on Thursday June 18, 2020 @10:13PM (#23570335)
And...exactly the same with mypy, either via in-library typings or the typeshed.

Projects in the npm ecosystem may be somewhat more likely to.have typings if the project exists, but I find that, for anything other than web frontend, where JS is obviously king, the tool I'm looking for is more likely to actually exist in the python ecosystem.

Re:Practical Python Programming by jakear on Thursday June 18, 2020 @10:50PM (#23570497)
Are there mypy typings available for things like sci-py and simpletransformers, and if so how do I acquire them?
Re:Practical Python Programming by ghostwriter on Friday June 19, 2020 @07:29AM (#23573297)
You can gradually annotate these packages locally for your project with [1], and then contribute it to [2].

Automatic stub generation may also be helpful [3]

[1] https://github.com/python/mypy/wiki/Creating-Stubs-For-Pytho...

[2] https://github.com/python/typeshed

[3] https://mypy.readthedocs.io/en/stable/stubgen.html

Re:Practical Python Programming by jakear on Friday June 19, 2020 @04:42PM (#23578683)
There’s a couple dozen packages on there. This can’t be described as “exactly the same” as npm/typescript if the scale and level of community involvement [1] is nowhere near the same.

1: among the most important things here, in addition to the strength of the type system, where mypy also lacks

Re:Practical Python Programming by ptx on Friday June 19, 2020 @06:58AM (#23573132)
People love the language because the language doesn't matter?

I don't think that quite explains it. We loved Python at version 1, before pip and PyPI were around - although the "batteries included" standard library played a similar role to some extent. For me it's mostly the syntax and the simplicity.

Re:Practical Python Programming by sooheon on Friday June 19, 2020 @11:01AM (#23575180)
Just my opinion, as someone who loves the ecosystem and tolerates the language.