PaulHoule 2 days ago

Yuck! It is no solution to have to write your function 3x! Also no solution to have to specifically say what version you want when you're calling!

Note that the most common use case for this is an API client where you are writing a large number of methods that look like

  def call(x):
     response=http_call(transform_parameters(x))
     return transform_response(parameters)
and the right answer is to treat this as a template which has two transform_X slots and code generate the sync and async versions, you then generate sync and async client classes and just make the class you want to use once and use it without any more ceremony. If superfunctions was the cure I'd rather have the disease.