DEV Community

Discussion on: Typeclasses in Python

Collapse
 
pauleveritt profile image
Paul Everitt

I believe you discussed it in a ticket and I don't want to pollute your tracker with questions.

Any chance of varying dispatch by more than one criteria? Pyramid has a concept of predicates which let you have a number of view registrations, each with different predicates saying which should be used. The choice is then kind of a score-based system.

My guess (and I believe your ticket answer) is it's just not feasible in the type system.

Collapse
 
sobolevn profile image
Nikita Sobolev

Hi!

Any chance of varying dispatch by more than one criteria?

Do you mean something like multidispatch? github.com/mrocklin/multipledispatch

I don't think that it is possible right now, but this is totally something I would love to add. But, before going deeper we need to fix some performance and typing issues.

Glad that you are interested in dry-python!