Closed srush closed 6 months ago
Thank you, Sasha! I'll take a closer look at the PR in the next couple of days (on Thursday probably). The penzai visualization looks sleek! I think it can be really useful for debugging!
- Make Visitor define an explicit generic argument for its down / up elements.
Nice; I like that we now have the input type explicitly specified for the visit
methods!
Default behavior is that the down element is a monoid and define default behavoirs for compose, empty, etc.
I was curious: for the ToSVG
visitor, the return type is svgwrite.base.BaseElement
; how does that the type system know that this is a Monoid
?
By the way, how do you type check code? Are you still using mypy
? Which version and which options?
Oh the BaseElement thing might be a bug. I think MyPy doesn't have the stubs for svgwrite
and so it is likely failing to check that.
I am using mypy 1.10, should we switch to pyright?
Thanks for the pull request and merge!
I am using mypy 1.10, should we switch to pyright?
Hmm... I don't have a strong opinion towards one or the other. But I see that pyright reports a few errors on our codebase (although I expect these to be fixable).
K, I think I'll fix these, bump the required version to 3.10+, update the docs, and then up the version number. Excited to check out the animation lib as well.
I was reading about some of the more recent updates to the Python type system and thought I would try a new version of the chalk core that fixed things that bothered me. This is a rather big PR, but most of it is pretty simple.
Changes:
Issues:
Why?
https://chalk-diagrams.github.io/viz/