Cecil Curry
Cecil Curry
> caching was not possible before, but now could be possible with `type_of = infer_type` **Superbness!** Caching is life. It's a relief that I only have to implement `infer_type()`; `infer_type_narrow()`...
*...heh.* Memoization, huh? I :heart_eyes_cat: memoization, because Python without memoization is a bear without salmon. But memoization kinda breaks down when `n` callers across `m` third-party packages are all passing...
**Resolved by f438dca4ab8e8a.** That sure escalated fast – real, *real* fast. In fact, this escalated so fast I ~~lost~~ invested an entire summer in this single feature request. It was...
**lol.** And thus we reopen. @beartype 0.19.0 is no closer than it ever was, huh? Thanks so much for fact-checking me, @Moosems. Looks like I'd better add this `pygments` example...
**Resolved by c89a72e85bc16747aaf.** Your time has come, `pygments.lexers.PythonLexer`! Interestingly, `infer_hint()` is *a lot* smarter than even [your fascinatingly hardboiled example](https://github.com/beartype/beartype/issues/403#issuecomment-2308614180), @Moosems. `infer_hint()` wants to be seen as an AI, because...
**Improved by 4c203c90a49a.** I... I couldn't help myself. I spent Sunday building even more horrifying intelligence into `infer_hint()`, @Moosems. [Your torture test](https://github.com/beartype/beartype/issues/403#issuecomment-2308614180) included a `lambda` function. `infer_hint()` *should* have inferred...
**Excellent!** I don't know how you do it, but... *you're always right about everything.* Seriously. It's kinda weird. Most users are usually wrong about *something,* eventually. That isn't happening here....
**HOLY BALLS!** This is... *brilliance.* Eventually, @beartype would like to eat Pydantic's breakfast by replacing Pydantic-style web validation with itself. Of course, Pydantic would also like to eat @beartype's breakfast...
> But it allows me to use the power of beartype.O1 and not write some assertions manually for non-speed-critical places. **Totally.** You're right. It's a good solution, because it works...
**OMG.** Technically, @beartype is actually right for once. [PEP 544-compliant protocols](https://peps.python.org/pep-0544/#runtime-checkable-decorator-and-narrowing-types-by-isinstance) (i.e., `typing.Protocol` and `typing_extension.Protocol` subclasses) are only usable at runtime when explicitly decorated by the official `@typing.runtime_checkable` decorator. Because...