Skip to content

What to do with duplicates? #180

Closed
Closed
@sobolevn

Description

@sobolevn

For example:

@typeclass
def some(instance): ...

@some.instance(int):
def _some_int1(instance: int): ...

@some.instance(int):
def _some_int2(instance: int): ...

There are several things we can do:

  1. Allow this, in this case we need to provide a test case and docs about when this can be useful
  2. Add options, like @typeclass(final=True), it won't allow exact duplicates when activated, but by default we will allow it
  3. Always forbid, but in this case people might end up with a situation when they need to override an existing behaviour but can't

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions