[issue43786] slice(None) is slice(None) is False

2021-04-09 Thread Nico Schlömer

New submission from Nico Schlömer :

I stumbled upon this when dealing with NumPy arrays:
```
slice(None) is slice(None)
```
```
False
```
This came up when trying to check if a variable `a` equals `slice(None)`. The 
comparison
```
a = slice(None)
a == slice(None)
```
```
True
```
works, but doesn't return a single Boolean if a is a NumPy array, for example.

Perhaps there's another way of finding out if a variable is exactly 
`slice(None)`, but the failure of `is` seems like a bug.

--
messages: 390598
nosy: nschloe
priority: normal
severity: normal
status: open
title: slice(None) is slice(None) is False

___
Python tracker 
<https://bugs.python.org/issue43786>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43786] slice(None) is slice(None) is False

2021-04-09 Thread Nico Schlömer

Nico Schlömer  added the comment:

Thanks very much, Steven, for the feedback and the suggestion.

--

___
Python tracker 
<https://bugs.python.org/issue43786>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29282] Fused multiply-add: proposal to add math.fma()

2018-02-20 Thread Nico Schlömer

Nico Schlömer  added the comment:

Do I read this thread correctly assuming that this hasn't been implemented yet? 
If not, I would probably make my own little library for this -- I really need 
the feature for the precision.

--
nosy: +nschloe

___
Python tracker 
<https://bugs.python.org/issue29282>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29282] Fused multiply-add: proposal to add math.fma()

2018-02-20 Thread Nico Schlömer

Nico Schlömer  added the comment:

> Existing libm implementations don't work,

Okay. Is this because of the inf/NaN discrimination hiccups mentioned above or 
are there any other pitfalls?

--

___
Python tracker 
<https://bugs.python.org/issue29282>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29282] Fused multiply-add: proposal to add math.fma()

2018-02-21 Thread Nico Schlömer

Nico Schlömer  added the comment:

Okay, thanks for the info.

As a stop-gap measure, I've created pyfma [1, 2]. Install with
```
pip install pyfma
```
and use with
```
pyfma.fma(3.0, 2.0, 1.0)
```
Only works on Unix reliable then, but that's all I care about. :)

Cheers,
Nico

[1] https://github.com/nschloe/pyfma
[2] https://pypi.python.org/pypi/pyfma

--

___
Python tracker 
<https://bugs.python.org/issue29282>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31415] Add -X option to show import time

2018-07-01 Thread Nico Schlömer

Nico Schlömer  added the comment:

I just updated tuna [1] to support import time profiles as well.
Install with
```
pip install tuna
```
and use with
```
python -X importprofile yourfile.py 2> import.log
tuna import.log
```
See screenshot for example output.

Cheers,
Nico

[1] https://github.com/nschloe/tuna

--
nosy: +nschloe
Added file: https://bugs.python.org/file47663/sc.png

___
Python tracker 
<https://bugs.python.org/issue31415>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com