Skip to content

Consider exposing sync functions through the same module using a decorator #582

@namsnath

Description

@namsnath

Sync versions of functions are defined in separate modules, and require maintaining a separate set of functions with identical signatures.

There is a possibility to explore using a decorator to expose sync versions of functions as properties.
Example:

@support_sync
async def some_fn():
  pass

await some_fn()
some_fn.sync()

Rough decorator setup:

def support_sync(fn):
  fn.sync = sync(fn)

Types can be inferred from the input fn.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions