Skip to content

Handling position-only arguments  #14

@thorwhalen

Description

@thorwhalen

I've tried this with object dispatching:

backend_store = {
    'some_key': b'some_value',
    'some_other_key': b'some_other_value',
}

handlers = [
    dict(
        endpoint=backend_store,
        name='backend_store',
        attr_names=['__getitem__', '__setitem__'],
    ),
]

Can't use this because the two methods have only positional-only arguments, and the protocol is:

url = 'http://localhost:3030/backend_store'
add_args = {
  "_attr_name": '__getitem__',
  "key": 'some_key'
}
requests.post(url, json=add_args).json()

Maybe this is a general problem (need to try functions with positional only arguments).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions