Productivity: Time spent writing code vs test/debug/fix?

Have you tried type hinting + PyCharm? It's not perfect, but surprisingly helpful. I don't think I could ever go back to Python development without it (because I absolutely felt your pain).

1 Like

Type hinting helps but alas I'm stuck on Python 2.x, so it's not so pervasive. I'm certainly not convinced that coding Rust is any slower than coding Python - I think for coding in the large Rust easily wins.

There's a Python 2.7 compatible flavor that uses comments, but I agree it's not as nice to use. And you're right that many third party libraries unfortunately don't use it yet. PyCharm can infer the types often, but only about 60% of the time for un-type hinted code.

Python 3 flavor:

def embezzle(self, account: str, funds: int = 1000000, *fake_receipts: str) -> None:
    """Embezzle funds from account using fake receipts."""
    <code goes here>

is equivalent to the following Python 2.7:

def embezzle(self, account, funds=1000000, *fake_receipts):
    # type: (str, int, *str) -> None
    """Embezzle funds from account using fake receipts."""
    <code goes here>
2 Likes

Thanks - I've been using type: on vars but on functions. - That helps a lot.
(Python is still a poor man's Rust.)