You'd write predicates that return whether a value matches a category then def func(value: the_predicate) and a decorator to evaluate the predicate and perform category overload resolution depending on the result
The trickiest part would be the ordering of predicates when a value matches several
Basically @singledispatch but the overload resolution happens with partially ordered predicates instead of types
Maybe raise an AmbiguousResolutionError exception or smth when the partial ordering can't be properly resolved
@Morwenn I agree that attract them back with an active community is better than chasing after individual ones. But it's like a nuclear reaction - you need a critical mass to start with. It's easier to attract more people when you already have a lot of people to start with.
Depends, it's mostly duck typing and polymorphism all over the place
isinstance is an obvious tool to have in your toolbox but not an everyday tool either
Like, you don't overload functions on type (unless you're using @singledispatch), somehow everything is overloaded on the type of self and you use that a lot
If you can't modify the class yourself for polymorphic behaviour, then sure you have to resort to isinstance
One other part not keeping up with type hinting is the import system. Would be cool if when you imported a function you implicitly imported all the types?
Many libraries decided to split into two parts anyway: normal library without type hints on one hand, stubs/prototypes with types hints on the other hand
This design was proposed so that there wouldn't be any penalty in regular code (because type hints have a cost, even though it's getting better), but IDE could use the stubs to retrieve the hints for autocompletion and type checking
So if you have a signature like def my_function(a : FOO, b : BAR) you might want to import FOO and BAR from another .py file. What I'd like is an automatic import of FOO and BAR when you import my_function.
Each binary takes 2 - 4GB to compile because after preprocessing, the compiler is seeing essentially a single file with about 400k lines of code that are heavily templated.
That's true, but it felt more "right" than to use std::less<void> which is "a specialization of a class template but I could as well be non templated at the class level"
lol at that link
I'll probably keep std::less<> as the basis and just special handling of std::ranges::less where needed :x
That's why my personal projects are slow: design decisions take forever