On Tue, Jun 23, 2020 at 2:59 PM Wes Turner wrote:
> > ∆y(P, H,L, E, I) := H * L^4 * P / (384 * E * I)
>
> ```python
> Δy = lambda P, H, L, E, I: H * L**4 * P / (384 * E * I)
> Δy
> ```
> (P, H, L, E, I)>
>
> Is there a good way to redefine the '^' operator for {int, float, Decimal,
> Fracti
> ∆y(P, H,L, E, I) := H * L^4 * P / (384 * E * I)
```python
Δy = lambda P, H, L, E, I: H * L**4 * P / (384 * E * I)
Δy
```
(P, H, L, E, I)>
Is there a good way to redefine the '^' operator for {int, float, Decimal,
Fraction, numbers.Number}? Why would it be dangerous to monkey-patch global
On Tue, Jun 23, 2020 at 11:09 AM Rhodri James wrote:
> On 23/06/2020 15:12, Ricky Teachey wrote:
> > On Tue, Jun 23, 2020 at 9:08 AM Mathew Elman
> wrote:
> >
> >> Well there you go, good point.
> >> I didn't really like it being an operator myself. But I can see having a
> >> math.tolerance cla
On 23/06/2020 15:12, Ricky Teachey wrote:
On Tue, Jun 23, 2020 at 9:08 AM Mathew Elman wrote:
Well there you go, good point.
I didn't really like it being an operator myself. But I can see having a
math.tolerance class being useful.
On Tue, 23 Jun 2020 at 13:53, Jonathan Goble wrote:
On Tu
On Tue, Jun 23, 2020 at 9:08 AM Mathew Elman wrote:
> Well there you go, good point.
> I didn't really like it being an operator myself. But I can see having a
> math.tolerance class being useful.
>
> On Tue, 23 Jun 2020 at 13:53, Jonathan Goble wrote:
>
>> On Tue, Jun 23, 2020 at 8:44 AM Mathew
Well there you go, good point.
I didn't really like it being an operator myself. But I can see having a
math.tolerance class being useful.
On Tue, 23 Jun 2020 at 13:53, Jonathan Goble wrote:
> On Tue, Jun 23, 2020 at 8:44 AM Mathew Elman
> wrote:
>
>> Perhaps a more versatile operator would be
On Tue, Jun 23, 2020 at 8:44 AM Mathew Elman wrote:
> Perhaps a more versatile operator would be to introduce a +- operator that
> would return an object with an __eq__ method that checks for equality in
> the tolerance i.e
>
> a == b +- 0.5
>
This is already valid syntax, because unary minu
Perhaps a more versatile operator would be to introduce a +- operator that
would return an object with an __eq__ method that checks for equality in
the tolerance i.e
a == b +- 0.5
Although I don't like this either since you could achieve the same thing
with something like this:
class Tol
On 23/06/20 3:23 am, Jonathan Crall wrote:
Indicator variables which take a value of either zero are one are
extremely common.
Yes, but they're explicitly defined as numbers, not truth values.
--
Greg
___
Python-ideas mailing list -- python-ideas@pyt