[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/issue43

[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

[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.

Re: cProfile, timed call tree

2018-05-28 Thread Nico Schlömer
Thanks, Dieter, for the concise answer. Cheers, Nico On Sat, May 26, 2018 at 7:42 AM dieter <die...@handshake.de> wrote: > Nico Schlömer <nico.schloe...@gmail.com> writes: > > > From what I understand about the Python profilers, the type of > information >

cProfile, timed call tree

2018-05-25 Thread Nico Schlömer
Hi everyone, >From what I understand about the Python profilers, the type of information you get from a stats object is * How much time was spent in function X, * what the callers and callees of function X are, and * and bunch of meta info about function X. With the program ``` def

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

2018-02-21 Thread Nico Schlömer
Nico Schlömer <nico.schloe...@gmail.com> 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. :)

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

2018-02-20 Thread Nico Schlömer
Nico Schlömer <nico.schloe...@gmail.com> 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 tra

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

2018-02-20 Thread Nico Schlömer
Nico Schlömer <nico.schloe...@gmail.com> 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: +n

itertools: problem with nested groupby, list()

2010-05-04 Thread Nico Schlömer
Hi, I ran into a bit of an unexpected issue here with itertools, and I need to say that I discovered itertools only recently, so maybe my way of approaching the problem is not what I want to do. Anyway, the problem is the following: I have a list of dictionaries, something like [ { a: 1, b: 1,

Re: itertools: problem with nested groupby, list()

2010-05-04 Thread Nico Schlömer
. -- I'll look at Uli's comments. Cheers, Nico On Tue, May 4, 2010 at 1:08 PM, Jon Clements jon...@googlemail.com wrote: On 4 May, 11:10, Nico Schlömer nico.schloe...@gmail.com wrote: Hi, I ran into a bit of an unexpected issue here with itertools, and I need to say that I discovered

Re: itertools: problem with nested groupby, list()

2010-05-04 Thread Nico Schlömer
they are called generators) and you should be fine. I'll look into this, thanks for the hint. Cheers, Nico On Tue, May 4, 2010 at 12:46 PM, Ulrich Eckhardt eckha...@satorlaser.com wrote: Nico Schlömer wrote: I ran into a bit of an unexpected issue here with itertools, and I need to say

Re: itertools: problem with nested groupby, list()

2010-05-04 Thread Nico Schlömer
: On 4 May, 12:36, Nico Schlömer nico.schloe...@gmail.com wrote: Does this example help at all? Thanks, that clarified things a lot! To make it easier, let's just look at 'a' and 'b': my_list.sort( key=itemgetter('a','b','c') ) for a, a_iter in groupby(my_list, itemgetter('a')):    print