diazona,
@diazona@techhub.social avatar

@cpontvieux @rochacbruno @nedbat I don't remember offhand if this works, but what about giving the TypedDict subclass a custom constructor that fills in the default values? It wouldn't be quite as convenient as the dataclass-like syntax, but for a one-off use it should do the trick.

I guess if you really wanted to you could write a metaclass that enables defaults in TypedDict. (Maybe. Again, not sure if it'd work but I can't think of a reason it wouldn't off the top of my head) It may not be worth the effort though.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • python
  • rosin
  • magazineikmin
  • GTA5RPClips
  • khanakhh
  • InstantRegret
  • Youngstown
  • mdbf
  • slotface
  • thenastyranch
  • everett
  • osvaldo12
  • kavyap
  • cubers
  • DreamBathrooms
  • megavids
  • Durango
  • modclub
  • ngwrru68w68
  • vwfavf
  • ethstaker
  • tester
  • cisconetworking
  • tacticalgear
  • Leos
  • provamag3
  • normalnudes
  • anitta
  • JUstTest
  • All magazines