[Python-ideas] Re: classmethod __eq__ comparisons and Any wildcards

2021-09-14 Thread johnmelendowski
As pointed out, you want metaclass for this. A warning, I've overwritten many of the dunders on classes for fun and I actually broke the ability to repr my class in certain situations by overriding __eq__ and/or __hash__ something deep in ipython/python with the repr. I forget the exact situatio

[Python-ideas] Re: 'Infinity' constant in Python

2020-11-23 Thread johnmelendowski
IEEE 754 is incredibly consistent with mathematics. The easiest way to determine if a float operation would return inf, -inf, or NaN is to quite literally make an expression and take the limit of it as a certain variable approaches infinity. 0/0, inf/inf, 0*inf, inf-inf are standard Indeterm