13 votes

Python built-ins worth learning

2 comments

  1. [2]
    unknown user
    Link
    BTW one great thing coming to python is type annotations. I'm using them along with mypy in my current project, and they've simplified a lot of things, even tho they are not perfected yet. When I...

    BTW one great thing coming to python is type annotations. I'm using them along with mypy in my current project, and they've simplified a lot of things, even tho they are not perfected yet. When I was in the market for a language for this project (which is a rather simple one TBH), the one thing that made Python a worthwhile choice was availability of libraries and availability of typechecking. It's also incremental which makes it really usable (e.g. I had issues with auto-generated Mako type stubs [thing C .h files] and just ignoring typechecking on it allowed me to progress instead of getting stuck fixing autogen'd or other-people's code).

    2 votes
    1. Deimos
      Link Parent
      Yeah, I'm using type annotations with mypy quite strictly for Tildes' code. For example, I'm blocked from committing if a new function doesn't have annotations. It's been pretty decent overall,...

      Yeah, I'm using type annotations with mypy quite strictly for Tildes' code. For example, I'm blocked from committing if a new function doesn't have annotations.

      It's been pretty decent overall, and has definitely prevented me from making some errors. However, they're still pretty early, and I don't think I'd recommend them unreservedly to everyone yet. I've ran into a few issues that can be tricky to debug, and I've had to report a number of issues to the mypy devs (and do a couple of pull requests to fix incorrect stubs, like this one recently).

      They're absolutely useful, but I think it'll still take a while until they're fully usable.

      1 vote