5 ms·
Things I miss when I am programming in python: - nothing similar to a build system that manages the external libraries - no type checking, it means: no autoco
by jorgemf 9y ago
Things I miss when I am programming in python:
- nothing similar to a build system that manages the external libraries
- no type checking, it means: no autocomplete in the IDE, runtime errors due to a value not expected
I don't mind to use python for small things, but for medium-big project I don't know how people can handle it.
- nerdponx 9y agoType hinting and analysis with MyPy (plus great IDE support in PyCharm) is a start.
- jorgemf 9y agoI use Intellij idea with the Python plugin, it gives you some hints, but for complex things it is just useless. And I cannot use MyPy because I have to use python, if I can choose other language or thing I would go with something not under development and far from python.
- mnarayan01 9y agoIf you do the work suggested in https://www.jetbrains.com/help/pycharm/type-hinting-in-pycharm.html https://www.jetbrains.com/help/pycharm/type-hinting-in-pycha... which references https://www.python.org/dev/peps/pep-0484/ https://www.python.org/dev/peps/pep-0484/ and https://www.python.org/dev/peps/pep-0526/ https://www.python.org/dev/peps/pep-0526/ then it can do a pretty good (though not perfect) job. That said...getting it there can take quite a bit of work, particularly w.r.t. third-party libraries.
- jorgemf 9y agoThanks. Not sure if it is useful for me as I still have to use python 2.7 UPDATE: I didn't see the python stubs, that made my day! lot of thanks for it!
- mnarayan01 9y agoYea I'm in the same boat. It's nice, though there are definitely warts. For third-party stuff stubs are a big help. For stuff I'm actively working on I've found comments/docstrings (I've used reStructuredText) to be useful: self.ivar = 1 # type: int self.ivar = [1] """ :type: list[int] """ def fun(arg1, arg2): # type: (int, str) -> str def fun(arg): """ :param int or str arg: :rtype: str or None """ I like the comment version (e.g. `# type: int`) better (plus its officially defined in PEP 484), but sadly they tend not to work as well, sometimes due to not being able to `import typing`, and sometimes for other less clear reasons.
- Spiritus 9y ago>And I cannot use MyPy because I have to use python What? That makes no sense! I think you should take another look at MyPy.
- nerdponx 9y agoMyPy is just a static checker. It isn't actually a python implementation, although a "typed python" would be interesting.
- ajmurmann 9y agoPip and pip files provide a basic dependency management system. To cargo and bundle are the guild standard, but this at least gets the job done. PyCharm has some autocompletion. But it's for some reason way behind what I'm used from Rubymine (fair comparison) and light-years from let's say IntelliJ (a little unfair comparison).
- jorgemf 9y agopip is too basic and it doesn't manage well when dependencies requires different version of the same package. Not even an error. I am used to IntelliJ with java/kotlin. So the autocomplete and type checking is far away, but I think it is because the language itself.
- fest 9y agoIn my experience, pip inside virtualenv manages dependencies very well. Completely agree on type checking point though.
- SomeStupidPoint 9y agoI always find Python gets unwieldy between 1k and 10k lines. Maybe I suck at Python.
- cpburns2009 9y agoI usually start splitting files around the 3k line mark into more encapsulated modules and classes.
- Daishiman 9y agoAs a general practice if a Python file goes beyond 2K lines of code I split it and modularize it. It's a great general rule for any programming language.
- dinglebert1234 9y agopip works fine. If your dependencies are that complex, you’re doing somethign wrong. Atom + Kite gives the best autocomplete I’ve seen on the market.