6 ms·
Could you expand? This looks similar to how it is done in Rust.
by _quick_q 10y ago
Could you expand? This looks similar to how it is done in Rust.
- RodericDay 10y agoIt looks very ugly to me, particularly the trying to reverse the original mistakes behind `int`, `list`, `dict` into `Int`, `List`, `Dict`. If you want to fix that, you fix that first, then apply it to a subsequent patch like this one. Additionally, I think Rust community, since its inception, embraced the goal of paying any up-front costs required for introspection. Meanwhile, the Python community seems to be tearing between those who want syntactical beauty and one-way-to-do-it, and those who are running big production systems using IDEs like PyCharm and wanting to benefit them. I'd prefer it if Python somehow warned people developing gigantic systems that maybe it's time to use a different language, instead of deforming Python to suit the people already running gigantic systems in a language unsuited to it.
- orf 10y agoType hints are completely optional. Nobody is getting torn, and both use cases are equally valid.
- RodericDay 10y agosee: "only one way to do it" Well, I'm not going to stop using Python or anything. I just think they're bad and ugly and I'm sad that more and more I'll open the source code of some library I'm using and find those "hints" littered everywhere. I would plea that people reconsider their inclusion, but it seems like that ship set sail.
- kjbflsudfb 10y agoThis is probably one of the fairest criticisms I've read and, honestly, I didn't even notice that when reading the PEP. Thanks for your insight.
- baq 10y agoi had a similar opinion not long ago (as in, couple of months). then i was shown what mypy can do. it's really worth it.