On 02/09/2021 11:41, Chris Angelico wrote:
On Thu, Sep 2, 2021 at 7:36 PM Peter Otten <__pete...@web.de> wrote:
On 02/09/2021 04:32, Steven D'Aprano wrote:
On Wed, Sep 01, 2021 at 03:40:37PM +0200, Peter Otten wrote:
Instead of removing it you might add a filter to get a sim
On 02/09/2021 04:32, Steven D'Aprano wrote:
On Wed, Sep 01, 2021 at 03:40:37PM +0200, Peter Otten wrote:
Instead of removing it you might add a filter to get a similar effect:
[...]
warnings.filterwarnings("always", "woof!")
Unfortunately that's too agg
On 01/09/2021 09:27, Steven D'Aprano wrote:
Maybe I'm missing something, but I don't think that there is anyway to
remove a warning from the warnings filter list so that it will be shown
again.
Example:
>>> import warnings
>>> warnings.warn("something happened")
:1: UserWarning:
On 26/08/2021 09:36, Marc-Andre Lemburg wrote:
In Python you can use a simple test for this:
I think you need math.isnan().
nan = float('nan')
l = [1,2,3,nan]
d = {nan:1, 2:3, 4:5, 5:nan}
s = set(l)
nan in l
True
That only works with identical nan-s, and because the container omits
the e
On 24/03/2021 23:35, adelf...@gmail.com wrote:
Several attempts in this thread to write "simpler" code that does this job
proved to be buggy. I feel there's some ground to say that having this in the library
could prevent other less talented writers make those or even bigger mistakes.
I feel a
Speaking as someone who's not into dataclasses:
This whole thread seems to be about spelling the initilizer's function
signature as a class body. Have you considered going in the opposite
direction, i. e. writing something like
@dataclass
class A:
@attributes_from_signature
def __init
On 21/02/2021 23:06, Terry Reedy wrote:
On 2/21/2021 12:04 PM, Paul Sokolovsky wrote:
Traceback (most recent call last):
File "pseudoc_tool.py", line 91, in
first_class_function_value(func, **pass_params)
TypeError: print() got an unexpected keyword argument 'noann'
This is not typic
M.-A. Lemburg wrote:
> Hi Ram,
>
> I think you are confusing the exception type with the exception
> reason. By adding 100 more exception types, you don't make things
> easier, but instead you complicate things, since we'd all have
> to memorize those 100 exception types.
>
> That said, enhancin
Richard Musil wrote:
> I have found myself in an awkward situation with current (Python 3.7) JSON
> module. Basically it boils down to how it handles floats. I had been hit
> on this particular case:
>
> In [31]: float(0.6441726684570313)
> Out[31]: 0.6441726684570312
>
> but I guess it really doe
Ronald Oussoren via Python-ideas wrote:
> It is also possible to fix the particular issue by using another with
> statement, that is use:
>
> with contextlib.closing(read_multiple(…)) as chunks:
>for contents in chunks:
>…
>
> Automatically closing the generator at the end of the for
Terry Reedy wrote:
> Alternate proposal: give the NameError class a .name instance method
> that extracts the name from the message. This should not increase the
> time to create an instance. You would then write 'err.name()' instead
> of 'err.name'. For 3.6
>
> def name(self):
> msg = self
11 matches
Mail list logo