On 17/10/2026 22:05, rbowman wrote:
> On Sat, 17 Oct 2026 17:12:26 +0100, Richard Kettlewell wrote: >
>> Still, typed doesn’t mean complete immiscibility of types (at least in >> Python), and a good thing too, since lots of operations take operands of >> different types. For example if d is an int and G is a Python object >> representing a point on an elliptic curve, I want to be able to write >> d*G, >> not mess around with function calls to do point multiplication.
> > I've been trying to get up to speed with type hints. Like 'private' > functions in Python they seem to depend on a gentleman's agreement not to > do bad things. Like TypeScript it helps but still has loopholes.
They are hints, so yes and no: if you run the code first through mypy or pyrefly (which I prefer) and it doesn't pass just don't run it. That's not really a loophole.
-- Static tumblelog generator: https://github.com/john-bokma/tumblelog/ Available as Python or Perl. Example tumblelog: https://plurrrr.com/