Wessel

Results 304 comments of Wessel

Whoa. Since `plum` actually still is free, it makes absolutely no sense to not use that name. I guess I just assumed that `plum` would have been taken. Thank you...

Thanks, @PhilipVinc, I will follow that procedure. :)

I attempted to claim the name `plum` on PyPI, but I'm getting an authentication error. Even though `plum` isn't registered on PyPI, it is registered on the test repository: https://test.pypi.org/project/plum/....

Hey @ggoretkin-bdai! If you would like the best performance, the simplest way is to only use [so-called faithful types](https://beartype.github.io/plum/types.html#performance-and-faithful-types). I'm actually thinking that `Val` is a faithful type, so simply...

Perhaps the definition is better understood in terms of natural language. Consider, for example, `Literal[1]`. Then `isinstance(x, Literal[1])` if and only if `x == 1`. (Note that `isinstance(x, Literal[1])` won't...

Hey @ggoretkin-bdai! Ah... I think my benchmark that I posted above is incorrect. By default `Val` is actually assumed to be faithful. That's my bad! What appears to be going...

How about something like this? ```python In [1]: from plum import dispatch, Val In [2]: _cache = {} In [3]: def convert(t, x): ...: try: ...: val = _cache[t] ...:...

@ggoretkin-bdai, to answer your questions: * Yes, ideally more caching should happen to optimise performance. I think that `is_type` can be safely cached, though I should think this over more...

Hey @patrick-kidger! Beartype's default strategy for checking whether a list is a `list[int]` is by randomly choosing an element and checking the type of that element. This enables Beartype to...

Right! I figured you'd be familiar with what's going on. :) Substituting the runtime type checker should be possible. Plum fundamentally only depends on implementations of `isinstance` and `issubclass`, which...