python

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

Generic Typing with `Iterable[str]` or `Collection[str]`: Should you use it?

I often find myself defining function args with list[SomeClass] type and think “do I really care that it’s a list? No, tuple or Generator is fine, too”. I then tend to use Iterable[SomeClass] or Collection[SomeClass]. But when it comes to str, I really don’t like that solution, because if you have this function:...

  • All
  • Subscribed
  • Moderated
  • Favorites
  • python@programming.dev
  • rosin
  • GTA5RPClips
  • Youngstown
  • InstantRegret
  • Durango
  • slotface
  • cubers
  • mdbf
  • kavyap
  • DreamBathrooms
  • khanakhh
  • rhentai
  • ethstaker
  • magazineikmin
  • lostlight
  • normalnudes
  • everett
  • modclub
  • tester
  • thenastyranch
  • osvaldo12
  • tacticalgear
  • relationshipadvice
  • HellsKitchen
  • Leos
  • cisconetworking
  • bokunoheroacademia
  • sketchdaily
  • All magazines