opinion: don't bother typing tests (intermediate) anthony explains

Поділитися
Вставка
  • Опубліковано 12 лис 2024
  • today I talk about the approach I take to gradual typing in python -- I don't bother with tests (and why)!
    intro to typing / mypy: • introduction to python...
    gradual typing with mypy: • gradual typing python ...
    playlist: • anthony explains
    ==========
    twitch: / anthonywritescode
    dicsord: / discord
    twitter: / codewithanthony
    github: github.com/aso...
    stream github: github.com/ant...
    I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!

КОМЕНТАРІ • 10

  • @tandavme
    @tandavme 3 роки тому +1

    for me types are mostly for readability, not for correctness (so no matter in tests or in actual code). You read function header and quickly understand what it does w/o reading docstrings

    • @anthonywritescode
      @anthonywritescode  3 роки тому

      sure, for this I'm specifically talking about static type checking

  • @stevenbrudenell
    @stevenbrudenell 3 роки тому +2

    I like to annotate tests as a way to test the annotations of the system-under-test. If some usage of the system-under-test is valid, but not annotated correctly, I want mypy to fail. Any thoughts on this?

    • @anthonywritescode
      @anthonywritescode  3 роки тому +1

      I do those rarely but I keep them separate from my "executable tests" -- I usually call them "types tests" and really only use them when the types are an important part of the public interface *or* they're sufficiently complicated

    • @stevenbrudenell
      @stevenbrudenell 3 роки тому +1

      @@anthonywritescode I would love a video on "type tests"! I've thought about this vaguely but I couldn't find precedent for it.

  • @ItzAnameOk
    @ItzAnameOk 3 роки тому +1

    Thank you Anthony, very cool!

  • @tej43
    @tej43 3 роки тому +1

    I want to purchase keyboard you use. Can you share product model or amazon url?

    • @anthonywritescode
      @anthonywritescode  3 роки тому

      yep! I do a review of the keyboard here (and the amazon link is in the description): ua-cam.com/video/DZgCUWf9DZM/v-deo.html

  • @sillybuttons925
    @sillybuttons925 3 роки тому +2

    I thought this was going to be "don't bother typing out test cases", as in writing tests :p