oliverandrich,
@oliverandrich@fosstodon.org avatar

Struggling a bit with the API of a #python library I write. I want to provide classes with sync and async methods. I am not sure if I prefer to use a single class with unprefixed and a-prefixed methods. Or if I want one class for sync and one for async behaviours. And if I split it in separate classes would you prefix the methods with an ‚a‘ in the async class?

pawamoy,
@pawamoy@fosstodon.org avatar

@oliverandrich maybe try to see what other popular projects do? HTTPX offers two classes, Client and AsyncClient. Both have equally named methods.

oliverandrich,
@oliverandrich@fosstodon.org avatar

@pawamoy httpx is one example that I am looking at. It results in some duplications, but this might be the more obvious approach.

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