On Sat, Nov 27, 2021 at 4:47 PM Ulli Horlacher
wrote:
>
> Richard Damon wrote:
>
> > On a somewhat locked down computer, the user does not have admin rights,
> > so needs to get 'IT' to run any installers that need admin permissions
> > to run.
> >
> > And EXE that just needs to be copied to the
How have you updated your (team's) standards and conventions for
docstrings, when using dataclasses?
NB the question is specifically class-related. Whereas many of the
examples 'here' are of functions; a docstring is a docstring, is a
docstring.
The original word on the subject is/was "PEP 257
On 2021-11-26 11:24 PM, dn via Python-list wrote:
On 26/11/2021 22.17, Frank Millman wrote:
In my program I have a for-loop like this -
for item in x[:-y]:
... [do stuff]
'y' may or may not be 0. If it is 0 I want to process the entire list
'x', but of course -0 equals 0, so it returns an
On 2021-11-26 11:17 AM, Frank Millman wrote:
Are there any other techniques anyone can suggest, or is the only
alternative to use if...then...else to cater for y = 0?
x[:-y or None]
Seems to work:
>>> l
['a', 'b', 'c', 'd', 'e']
>>> def f(x): return l[:-x or None]
...
>>> f(3)
['a', 'b']
>>>
Hello, my python 3.10 shell is not displaying the top menu. What should I
do?
--
Peter Mwale
Principal Economist
Ministry of Gender, Social Welfare and Community Development
Private Bag 320
Lilongwe 3
Cell: +265 998 605 723
Phone: +265 1 788 888
Fax: +265 1 788 093
E-mail: petermwal...@gmail.com
Ulli Horlacher wrote:
>Edmondo Giovannozzi wrote:
>> You can try to download winpython:
>> https://github.com/winpython/winpython/releases
>> It is an executable, but you don't need to execute it as it is a 7zip
>> compressed archive.
>> You may run it or use directly 7zip to decompress it, th
Il giorno venerdì 26 novembre 2021 alle 10:23:46 UTC+1 Frank Millman ha scritto:
> Hi all
>
> In my program I have a for-loop like this -
>
> >>> for item in x[:-y]:
> ...[do stuff]
>
> 'y' may or may not be 0. If it is 0 I want to process the entire list
> 'x', but of course -0 equals
Frank Millman writes:
> Hi all
>
> In my program I have a for-loop like this -
>
for item in x[:-y]:
> ... [do stuff]
>
> 'y' may or may not be 0. If it is 0 I want to process the entire list
> 'x', but of course -0 equals 0, so it returns an empty list.
>
> In theory I can say
>
for
Il giorno venerdì 26 novembre 2021 alle 08:13:50 UTC+1 Ulli Horlacher ha
scritto:
> Avi Gross wrote:
>
> > I am not sure what your real problem is, Ulli, but many antivirus programs
> > can be TEMPORARILY shut off.
> Meanwhile I found this configuration option.
> But this does not help me muc
Edmondo Giovannozzi wrote:
> You can try to download winpython:
> https://github.com/winpython/winpython/releases
> It is an executable, but you don't need to execute it as it is a 7zip
> compressed archive.
> You may run it or use directly 7zip to decompress it, the result will be the
> same.
Avi Gross wrote:
> I am not sure what your real problem is, Ulli, but many antivirus programs
> can be TEMPORARILY shut off.
Meanwhile I found this configuration option.
But this does not help me much, because my programs must run on other
Windows PCs of other users and they cannot disable the d
Richard Damon wrote:
> On a somewhat locked down computer, the user does not have admin rights,
> so needs to get 'IT' to run any installers that need admin permissions
> to run.
>
> And EXE that just needs to be copied to the computer and rhen just RUN,
> doesn't need IT to 'install' it (the
On 26/11/2021 22.17, Frank Millman wrote:
> In my program I have a for-loop like this -
>
for item in x[:-y]:
> ... [do stuff]
>
> 'y' may or may not be 0. If it is 0 I want to process the entire list
> 'x', but of course -0 equals 0, so it returns an empty list.
...
> But in my actual p
On 2021-11-26 11:17 AM, Frank Millman wrote:
Hi all
In my program I have a for-loop like this -
>>> for item in x[:-y]:
... [do stuff]
'y' may or may not be 0. If it is 0 I want to process the entire list
'x', but of course -0 equals 0, so it returns an empty list.
In theory I can say
On Fri, Nov 26, 2021 at 10:11 PM Rob Cliffe via Python-list
wrote:
> or, perhaps simplest, you could do
>
> for item in x[:-y or None]: # a value of None for a slice argument means
> "don't slice here"
> [do stuff]
>
This is the one I'd recommend. If you're negating a slice like this,
just a
You could evaluate y separately:
yval =
for item in x[:-yval] if yval else x:
[do stuff]
or you could do it using the walrus operator:
for item in x[:-yval] if (yval := ) else x:
[do stuff]
or, perhaps simplest, you could do
for item in x[:-y or None]: # a value of None for a slice a
Op 26/11/2021 om 10:17 schreef Frank Millman:
Hi all
In my program I have a for-loop like this -
>>> for item in x[:-y]:
... [do stuff]
'y' may or may not be 0. If it is 0 I want to process the entire list
'x', but of course -0 equals 0, so it returns an empty list.
In theory I can say
Hi all
In my program I have a for-loop like this -
>>> for item in x[:-y]:
... [do stuff]
'y' may or may not be 0. If it is 0 I want to process the entire list
'x', but of course -0 equals 0, so it returns an empty list.
In theory I can say
>>> for item in x[:-y] if y else x:
... [do
18 matches
Mail list logo