How to use the multimethod.overload function in multimethod

To help you get started, we’ve selected a few multimethod examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github coady / multimethod / tests / test_methods.py View on Github external
    @overload
    def func(x: isa(int, float)):
        return -x
github chobeat / hypothesis-csv / src / hypothesis_csv / _data_rows.py View on Github external
@overload
def get_lines_num(draw, lines_param):
    raise InvalidArgument("Lines param must be an integer or None")
github chobeat / hypothesis-csv / src / hypothesis_csv / _data_rows.py View on Github external
@overload
def get_columns(draw, columns: isa(int)):
    columns = [draw(sampled_from(valid_column_types))() for _ in range(columns)]
    return columns