[Python-announce] unittest_expander 0.4.3 released

2023-03-20 Thread Jan Kaliszewski
I am pleased to announce the release of unittest_expander 0.4.3. The changelog is available at: https://unittest-expander.readthedocs.io/en/stable/changes.html *unittest_expander* is a MIT-licensed Python library that provides flexible and easy-to-use tools to parameterize your unit tests,

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-20 Thread Thomas Passin
On 3/20/2023 11:21 AM, Edmondo Giovannozzi wrote: def sum1(): s = 0 for i in range(100): s += i return s def sum2(): return sum(range(100)) Here you already have the numbers you want to add. Actually using numpy you'll be much faster in this case: §

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-20 Thread MRAB
On 2023-03-20 15:21, Edmondo Giovannozzi wrote: > def sum1(): > s = 0 > for i in range(100): > s += i > return s > > def sum2(): > return sum(range(100)) Here you already have the numbers you want to add. Actually using numpy you'll be much faster in

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-20 Thread Edmondo Giovannozzi
> > def sum1(): > > s = 0 > > for i in range(100): > > s += i > > return s > > > > def sum2(): > > return sum(range(100)) > Here you already have the numbers you want to add. Actually using numpy you'll be much faster in this case: § import numpy as np §

Re: How to get get_body() to work? (about email)

2023-03-20 Thread Jon Ribbens via Python-list
On 2023-03-19, Greg Ewing wrote: > On 20/03/23 7:07 am, Jon Ribbens wrote: >> Ah, apparently it got removed in Python 3, which is a bit odd as the >> last I heard it was added in Python 2.2 in order to achieve consistency >> with other types. > > As far as I remember, the file type came into

Re: How to get get_body() to work? (about email)

2023-03-20 Thread Jon Ribbens via Python-list
On 2023-03-19, Stefan Ram wrote: > Jon Ribbens writes: >>(Also, I too find it annoying to have to avoid, but calling a local >>variable 'file' is somewhat suspect since it shadows the builtin.) > > Thanks for your remarks, but I'm not aware > of such a predefined name "file"! Ah, apparently

Re: How to get get_body() to work? (about email)

2023-03-20 Thread Jon Ribbens via Python-list
On 2023-03-19, Stefan Ram wrote: > Peng Yu writes: >>But when I try the following code, get_body() is not found. How to get >>get_body() to work? > > Did you know that this post of mine here was posted to > Usenet with a Python script I wrote? > > That Python script has a function to show

[Python-announce] ANN: pvlib-0.9.5 released

2023-03-20 Thread Dr. Mark Alexander Mikofski PhD
Dear Pythonistas and solar power enthusiasts, The maintainers are happy to announce a new release of pvlib python: software for simulating performance of photovoltaic solar energy systems. *v0.9.5 Highlights:* * The infinite_sheds model now has options to use the hay-davies transposition model