Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

The system was down for backups from 5am to 10am last Saturday.


devel / comp.lang.python / Object in List : how?

SubjectAuthor
* Object in List : how?Khairil Sitanggang
+* Re: Object in List : how?Dennis Lee Bieber
|`* Re: Object in List : how?Stefan Ram
| `* Re: Object in List : how?Dennis Lee Bieber
|  `- Re: Object in List : how?Khairil Sitanggang
`- Re: Object in List : how?Stefan Ram

1
Object in List : how?

<mailman.72.1658608966.20444.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=23340&group=comp.lang.python#23340

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!news.freedyn.de!speedkom.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ksit70@gmail.com (Khairil Sitanggang)
Newsgroups: comp.lang.python
Subject: Object in List : how?
Date: Fri, 22 Jul 2022 23:28:11 -0500
Lines: 30
Message-ID: <mailman.72.1658608966.20444.python-list@python.org>
References: <CAB1Fbo2zE932BQZ8Dc794E35TtBJCC5krCzw+=3ep1mabzmW0w@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de WAyGLJFfKdRAVxoPBDuHWw4rSgxs61/w5DDZIXEUxk4Q==
Return-Path: <ksit70@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=Fx9aJgre;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.022
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'def': 0.04; '???': 0.07;
'python.': 0.08; 'subject:how': 0.09; 'code.\xc2\xa0': 0.16;
'node': 0.16; 'purpose?': 0.16; 'code.': 0.17; 'to:addr:python-
list': 0.20; 'skip:_ 10': 0.22; '8bit%:19': 0.31; 'message-
id:@mail.gmail.com': 0.32; 'received:google.com': 0.34; 'trying':
0.35; 'from:addr:gmail.com': 0.35; 'using': 0.37;
'received:209.85': 0.37; 'class': 0.37; 'received:209': 0.39;
'below': 0.69; 'subject:List': 0.71; 'subject: : ': 0.81; 'say,':
0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:from:date:message-id:subject:to;
bh=Ku/Ph60xJ2fkxJGrIRWHIlupCuHMacJKNqEzvXQEKqo=;
b=Fx9aJgreGa3c/1TgXMcDiJ/6HxJmf1JK8ypsbMVSZz3iif6z5LDytGKgft2Tl3WLWg
g+NuYClECHIN5VnJnCy+g1EKwm0qPsgBPyNzOX4dwfB90y+EPD1J46XZ1liirQZAa7ww
3BM2a7+qkpMlLxqnTTOP/sfJsMBruqYw7cETJPIbvhuJlFN77+9HNF937huLb7OcTfsF
na+vSfiV5DRwAvtQf7DRrVRf89QDK8p8HI64d5fVwnfUFv6Y1mI2cI8Oc53JlaiuaJeh
pYjb+SV9a+u8QlOcGfu68Fq45/NSZdR5d8j5coMpVUSZEZMYEyxDCtGoZ7L6EQXvNPoC
CB1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=Ku/Ph60xJ2fkxJGrIRWHIlupCuHMacJKNqEzvXQEKqo=;
b=AFjNyL9EsaLjARkMfQNkHHmdORph8ZNyl/1pwjMU+Sh9Umb1wiydLYjOyuw60Nuyk7
U0y4Tx3KTv7m21SlVvKJNQ9Teey28CDKC9PCgEK+iMALDhqW1SLv16Mwh4PMWaNx2UD9
rl1pv0IVp4CGYXMXVhrttj3gGb079hGqhH4gA+fSQ5P8eNEzHK7/BFdG/FLiYavHImaO
HN+yRnAoNOg8n2LRVBK691akWU80oVadYRfk3J+H13OJUNbGmWQVxfx3Lq3/xrL+iV32
ghLZZqZzMzcfC/rozK5iKjfXTikxFtq5SIxfr51+wl9gOtIrwDbJqK1bRHuqmTMyaodL
KDFQ==
X-Gm-Message-State: AJIora/EWlAJdHE4rOslAYmcS3f3YuKT6MmnzziJ9pHhkpzLTw+X61Jr
AiN5+KOKYP3tWetjagoHo3vKfrmpBJYOxDrwIkGoKYaGSqZu9w==
X-Google-Smtp-Source: AGRyM1vni/uWP5rMIf2WToc0+4YzHTQodCqcSoLfXeJja1P7gn1p/o9KkWhqnEzrPXfeN05tAUYXtW+uPB01FjI+zKA=
X-Received: by 2002:a5d:6e88:0:b0:21a:3403:9aa0 with SMTP id
k8-20020a5d6e88000000b0021a34039aa0mr1772609wrz.379.1658550501527; Fri, 22
Jul 2022 21:28:21 -0700 (PDT)
X-Mailman-Approved-At: Sat, 23 Jul 2022 16:42:45 -0400
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAB1Fbo2zE932BQZ8Dc794E35TtBJCC5krCzw+=3ep1mabzmW0w@mail.gmail.com>
 by: Khairil Sitanggang - Sat, 23 Jul 2022 04:28 UTC

Hello Expert:

I just started using python. Below is a simple code. I was trying to check
if, say, NO1 is not in the NODELIST[:].NO
How can I achieve this purpose?

Regards,
-Irfan

class Node:
def __init__(self):
self.NO = 0
self.A = 20

NODE = Node()
NODELIST = []

NODE.NO = 10
NODELIST.append(NODE)

NODE.NO = 20
NODELIST.append(NODE)

NODE.NO = 30
NODELIST.append(NODE)

NO1 = 20
if NO1 not in NODELIST[:].NO ???

Re: Object in List : how?

<mhnodhpl21n02qm099cvudbvomcgdo45a4@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=23342&group=comp.lang.python#23342

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 23 Jul 2022 15:55:26 -0500
From: wlfraed@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.python
Subject: Re: Object in List : how?
Date: Sat, 23 Jul 2022 16:55:28 -0400
Organization: IISS Elusive Unicorn
Message-ID: <mhnodhpl21n02qm099cvudbvomcgdo45a4@4ax.com>
References: <CAB1Fbo2zE932BQZ8Dc794E35TtBJCC5krCzw+=3ep1mabzmW0w@mail.gmail.com> <mailman.72.1658608966.20444.python-list@python.org>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 51
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-YJ5TvMU0RHqrn2pSdg5siX8rCYZgm2aOOxVuw53CDQPQL/WpESSNWZrkD0JLYiIlvY+lZtB4fhDsVvq!QJBE9a5bDJeDt3gMkN2NBo8zrD61phDake5MhcAeFPM5ofEb4AuKgkO2PlRbufdvBMaaXvQm
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2585
X-Received-Bytes: 2676
 by: Dennis Lee Bieber - Sat, 23 Jul 2022 20:55 UTC

On Fri, 22 Jul 2022 23:28:11 -0500, Khairil Sitanggang <ksit70@gmail.com>
declaimed the following:

>class Node:
> def __init__(self):
> self.NO = 0
> self.A = 20
>
>NODE = Node()
>NODELIST = []
>

Comment...

The convention is that ALL CAPS is used to indicate something that is
to be treated as a CONSTANT. Classes get capitalized initial letters. Names
of variable data is traditionally all lower case, lower case with _ between
"words" (eg: lower_case), or camel case (eg: camelCase).

>NODE.NO = 10
>NODELIST.append(NODE)
>
>NODE.NO = 20
>NODELIST.append(NODE)
>
>NODE.NO = 30
>NODELIST.append(NODE)
>
>
>NO1 = 20
>if NO1 not in NODELIST[:].NO ???

The [:], in this statement, just says "make a copy of nodelist". The
/list/ does not have an attribute named "NO". You have to ask for each
element IN the list.

One convoluted way (I've not tested it) is:

if len([node for node in nodelist if node.no == no1]):
print("Found at least one occurence")

This is a list comprehension; it loops over each element in nodelist,
making a new list if the element attribute matches the criteria. Python
treats 0 as "false" and if no element matched, the list created is empty,
so len() is 0. Anything else implies a match was found.

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: Object in List : how?

<membership-20220723225235@ram.dialup.fu-berlin.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=23346&group=comp.lang.python#23346

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Object in List : how?
Date: 23 Jul 2022 21:54:45 GMT
Organization: Stefan Ram
Lines: 14
Expires: 1 Apr 2023 11:59:58 GMT
Message-ID: <membership-20220723225235@ram.dialup.fu-berlin.de>
References: <mailman.72.1658608966.20444.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de xym/9UZuelitCu1KitmrcgjQRMKg+Emha5xVqKAn5sFAwm
X-Copyright: (C) Copyright 2022 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Sat, 23 Jul 2022 21:54 UTC

Khairil Sitanggang <ksit70@gmail.com> writes: I was trying to check
>if, say, NO1 is not in the NODELIST[:].NO
>How can I achieve this purpose?

To check whether an object is not a member of an object,
you can use "not in".

For example, the expression

1 not in[ 1, 2, 3 ]

evaluates to "False".

Re: Object in List : how?

<len-20220723235455@ram.dialup.fu-berlin.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=23350&group=comp.lang.python#23350

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Object in List : how?
Date: 23 Jul 2022 22:55:47 GMT
Organization: Stefan Ram
Lines: 12
Expires: 1 Apr 2023 11:59:58 GMT
Message-ID: <len-20220723235455@ram.dialup.fu-berlin.de>
References: <mailman.72.1658608966.20444.python-list@python.org> <mhnodhpl21n02qm099cvudbvomcgdo45a4@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de zsQRWooQgUFWpK775OC7JwGsltvPTjXbkSSc8FMP3YSmHK
X-Copyright: (C) Copyright 2022 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Sat, 23 Jul 2022 22:55 UTC

Dennis Lee Bieber <wlfraed@ix.netcom.com> writes:
> if len([node for node in nodelist if node.no == no1]):
> print("Found at least one occurence")

I'm not sure you need the "len"; an empty list already is falsy.

|>>> print( bool( [] ))
|False
|>>> print( bool( [ 1, 2, 3 ] ))
|True

Re: Object in List : how?

<qd5pdh1d3ukqf59tkvqs3l00isu5hlr7c8@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=23352&group=comp.lang.python#23352

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 23 Jul 2022 19:43:58 -0500
From: wlfraed@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.python
Subject: Re: Object in List : how?
Date: Sat, 23 Jul 2022 20:43:58 -0400
Organization: IISS Elusive Unicorn
Message-ID: <qd5pdh1d3ukqf59tkvqs3l00isu5hlr7c8@4ax.com>
References: <mailman.72.1658608966.20444.python-list@python.org> <mhnodhpl21n02qm099cvudbvomcgdo45a4@4ax.com> <len-20220723235455@ram.dialup.fu-berlin.de>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: Yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 16
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-aEjIAnYKuw5Fn8qPKwOjbqVoUIjyFs74GAF/E5iYshPfVt8zr5zDWwzkrTLxkLn9YzMPHYxcv7IB20i!uohlFwn9qWCCKjbn5UZhT6pLDq3PECSjMMZsYaVig9Qm5Yg6szrZX+8LDsJLUulMUC+t1Con
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1691
X-Received-Bytes: 1782
 by: Dennis Lee Bieber - Sun, 24 Jul 2022 00:43 UTC

On 23 Jul 2022 22:55:47 GMT, ram@zedat.fu-berlin.de (Stefan Ram) declaimed
the following:

>Dennis Lee Bieber <wlfraed@ix.netcom.com> writes:
>> if len([node for node in nodelist if node.no == no1]):
>> print("Found at least one occurence")
>
> I'm not sure you need the "len"; an empty list already is falsy.
>

Just wanted to be explicit for the OP.

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: Object in List : how?

<mailman.91.1658773809.20444.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=23365&group=comp.lang.python#23365

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ksit70@gmail.com (Khairil Sitanggang)
Newsgroups: comp.lang.python
Subject: Re: Object in List : how?
Date: Mon, 25 Jul 2022 13:29:55 -0500
Lines: 32
Message-ID: <mailman.91.1658773809.20444.python-list@python.org>
References: <mailman.72.1658608966.20444.python-list@python.org>
<mhnodhpl21n02qm099cvudbvomcgdo45a4@4ax.com>
<len-20220723235455@ram.dialup.fu-berlin.de>
<qd5pdh1d3ukqf59tkvqs3l00isu5hlr7c8@4ax.com>
<CAB1Fbo2SWXGUY4Bf0h99LV06Jun7wuV_=jruVdqye1RFR-uQ+A@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de jyseMSxjIcuCttbcQQjN3w7SIUCvnIn7xK9KYVXA6G8Q==
Return-Path: <ksit70@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=HDONRMzY;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.007
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'jul': 0.04; '2022': 0.05;
'cc:addr:python-list': 0.09; 'received:209.85.221.43': 0.09;
'received:mail-wr1-f43.google.com': 0.09; 'subject:how': 0.09;
'writes:': 0.09; 'coding': 0.13; '&gt;': 0.14; 'cc:no real
name:2**0': 0.14; 'url:mailman': 0.15; '&gt;&gt;\xc2\xa0': 0.16;
'explicit': 0.16; 'node': 0.16; 'wrote:': 0.16; 'python': 0.16;
'guidance': 0.19; 'cc:addr:python.org': 0.20; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'help.': 0.25; 'url:listinfo': 0.25; 'cc:2**0': 0.25; 'url-
ip:188.166/16': 0.25; 'again,': 0.26; 'community': 0.31; 'url-
ip:188/8': 0.31; '(this': 0.32; 'empty': 0.32; 'message-
id:@mail.gmail.com': 0.32; "i'm": 0.33; 'header:In-Reply-To:1':
0.34; 'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'mon,': 0.36; "it's": 0.37; 'received:209.85': 0.37;
'received:209': 0.39; 'least': 0.39; 'list': 0.39; 'skip:o 10':
0.61; 'love': 0.62; '25,': 0.62; 'email': 0.63; 'your': 0.64;
':)\xc2\xa0': 0.69; 'following:': 0.69; 'subject:List': 0.71;
'highly': 0.78; 'subject: : ': 0.81; 'proceed': 0.88
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=qXsnFdIYHXDw5+3OHKBTC6Iql4ybKZIoCJEXZRzNZyA=;
b=HDONRMzYkWd0rdHmZvhqZrMRNEYfogMxsAS2aGpvCIH19ZMdJGe7CrlH8Xe5fhxa/J
raR78tP6WA7hBTyJYLkCm4aCCdiiNAZdDeZ1S4ApskgpwG2nfHIVmRATYAaqOKHXlxVF
9OEzYa6JJCs78Qt2RAXkHVQGi5qvJ7X6l9bdBnGeO2b1z/FkG5qxFIXXUEpbOnJf6+rG
S4AWyLlZCgF1zQGrx2pndMn1cQkwc9vBmaVE1+SUDLFXuVw604dyjnQXEOCmj2KNbWdU
YCTiS66unlvsOGukNL6OUGWKz5cUiwN5yfaxdgkyhDfqMdh6XeEtqfgQTTyMag4LcvUB
DY+Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=qXsnFdIYHXDw5+3OHKBTC6Iql4ybKZIoCJEXZRzNZyA=;
b=NSLPLkdrC0VSXVDf3tCYkdbZ4Lu+Oxb/zqgDs0hP6z/oRJuOPRJ5xFs0afRIEGOPm0
oryBsvifo5jTmC0zRtXXSVVa/FYat+Q4BGkN94fFUY2klU1NX/7OpSo1qUWTODwz+odA
HsK/NvQ2qbnzGYYBfmWQCASxeiOeGSng+6cIRAv0/kTbwrX7CmAVs6kCHyQvsygKlW3F
zlGwwj3Ctf3YxoC5U73gn7wT9qiwbUBuaLb+Jq5SIr9a3fNR5G5ARQL3K0M7yQgycOrW
2ke+YfRym/0u3yurz1Gy9rjs4foU6+EYTSUIvjicnlhdhLtu1KoMzfvG4gh/MTDQwCtb
AA7g==
X-Gm-Message-State: AJIora912JU7+WxIcelNDZA25Sv1Iy+oTQecQRTSr1w2fmcdRf7sKuRH
qtboX6KPJYQYdkXcuYEy6YGqH8u3faEuCAtuidhfB/u89xo=
X-Google-Smtp-Source: AGRyM1sbswhXmHlSb9dxaAPHK/RCzpICqVsmNDVa/tyqt6XyCDfNdT/VXWlPl2svXhvwNNn7aTVgBrGhb0lrT2Z8uqA=
X-Received: by 2002:a5d:64c8:0:b0:21e:841d:b4fa with SMTP id
f8-20020a5d64c8000000b0021e841db4famr4933794wri.14.1658773806672; Mon, 25 Jul
2022 11:30:06 -0700 (PDT)
In-Reply-To: <qd5pdh1d3ukqf59tkvqs3l00isu5hlr7c8@4ax.com>
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAB1Fbo2SWXGUY4Bf0h99LV06Jun7wuV_=jruVdqye1RFR-uQ+A@mail.gmail.com>
X-Mailman-Original-References: <mailman.72.1658608966.20444.python-list@python.org>
<mhnodhpl21n02qm099cvudbvomcgdo45a4@4ax.com>
<len-20220723235455@ram.dialup.fu-berlin.de>
<qd5pdh1d3ukqf59tkvqs3l00isu5hlr7c8@4ax.com>
 by: Khairil Sitanggang - Mon, 25 Jul 2022 18:29 UTC

Again, thank you so much for all your suggestions; it's even easier for me
now to proceed with my coding with all the guidance in one place (this
email thread). I highly appreciate all of your help.
I love this python community :)

Regards,
-Irfan

On Mon, Jul 25, 2022 at 12:38 PM Dennis Lee Bieber <wlfraed@ix.netcom.com>
wrote:

> On 23 Jul 2022 22:55:47 GMT, ram@zedat.fu-berlin.de (Stefan Ram) declaimed
> the following:
>
> >Dennis Lee Bieber <wlfraed@ix.netcom.com> writes:
> >> if len([node for node in nodelist if node.no == no1]):
> >> print("Found at least one occurence")
> >
> > I'm not sure you need the "len"; an empty list already is falsy.
> >
>
> Just wanted to be explicit for the OP.
>
>
> --
> Wulfraed Dennis Lee Bieber AF6VN
> wlfraed@ix.netcom.com
> http://wlfraed.microdiversity.freeddns.org/
> --
> https://mail.python.org/mailman/listinfo/python-list
>


devel / comp.lang.python / Object in List : how?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor