Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Everything should be made as simple as possible, but not simpler. -- Albert Einstein


devel / comp.lang.python / Enums and nested classes

SubjectAuthor
* Enums and nested classesSam Ezeh
`* Re: Enums and nested classesGreg Ewing
 `- Re: Enums and nested classesEthan Furman

1
Enums and nested classes

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: sam.z.e...@gmail.com (Sam Ezeh)
Newsgroups: comp.lang.python
Subject: Enums and nested classes
Date: Wed, 20 Apr 2022 11:57:18 +0100
Lines: 30
Message-ID: <mailman.164.1650452253.20749.python-list@python.org>
References: <CAD+b3HgQmmHgSsfh5r28QoQh-OyH7VxMZVQ8RYcUMmK7_U6b2Q@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de aM5RX8DNKuer2z4xu+WSZAOi7uVGxYpdko/CJBQOmfTA==
Return-Path: <sam.z.ezeh@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=dHJSvSNr;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.039
X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'everyone,': 0.03; 'def':
0.04; 'behaviour': 0.16; 'nested': 0.16; 'subject:nested': 0.16;
'it?': 0.19; 'to:addr:python-list': 0.20; 'skip:_ 10': 0.22;
'examples': 0.25; 'anyone': 0.25; 'expect': 0.28; 'message-
id:@mail.gmail.com': 0.32; "i'm": 0.33; 'received:google.com':
0.34; 'bar': 0.35; 'from:addr:gmail.com': 0.35; 'received:209.85':
0.37; 'class': 0.37; 'received:209': 0.39; 'two': 0.39; 'use':
0.39; 'happen': 0.40; 'situation': 0.40; 'here': 0.62; 'your':
0.64; 'resulting': 0.70; '....': 0.76
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=I+e2NzXdufgpp94+uyCf+wIbjyeTtm18d6/K83YIeLU=;
b=dHJSvSNr4SumByZla5QJaFMe2fGF6LjW/Leukj7l7gBGobehPN/l/gXnNRmDehpMHz
cEE7xBMRrQE9u0zrrGtlB5X1soktNIMB/9Aj53Z1g8+TUIwS/t3Q+aIwEKORTsKfQ1zC
oadG9JG1Z0Se3czrZd/KW1puetjkvt5rPXkIvbfDO6JUm/as6uccDaQbKxN515irFF14
m5GLFQsW4RYR0MZZmlzyg5iM1uqN3HC0ANeacllsEKPcB87T2mXYDXcdZwqYhBIHPF78
Muq5/+7pRGsyOAukt2Ftuqxe+XPZ0b9tOiUzrAbSsx7415cfJhSuVsEYdgdi0u7JNp6w
jwDg==
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=I+e2NzXdufgpp94+uyCf+wIbjyeTtm18d6/K83YIeLU=;
b=2L1dXPBDJFbi8B4ftSmhEuhpWGzSqXLxV1xx7OQLr6tn99WkCQLz66PGC1WQoUPgel
8QbdY6mMqy4wK+HMxE9gt+PA4vjYVQdJmYelNWFZg5397CVvPfBN4m0LT+6CF9JqGmVN
8CfDQDPuHMMTnMY35ksuSW5nl7d1kkOw9S7Mr47Q3nZRHlv+vebBO2Mb3QQg5M5sCX9h
SZNxATtm/CTfxjR+gbOBfZV8m2TV+pGALyiqzZXAr8NhMjc0eXl9hLMx6p317N8b+SQk
gXrRxGIxySPQFnUJKNO/WPu8SsxIaN6tJJFuWvjXe6cnUCHwH/Q1UQFGxuY+imOFjI3F
/CTg==
X-Gm-Message-State: AOAM5319AlPxiNmc1R5Kb0r4S6OD2ZQUvlMut8hrXNSkKwTdLosFyM0m
6hKt6VMUpvJzQrc2so/MebxHLqGNls5LTovKGzmKSJ3FUao1kQ==
X-Google-Smtp-Source: ABdhPJx4kaOlLklN1oZDRMd+I+RCD5a0n4lziUedi1zdvKGjt39/Eh7USo0JToHaqYQHn10aOps7yufGDZslKmaO+GA=
X-Received: by 2002:a17:902:f78d:b0:14d:522e:deb3 with SMTP id
q13-20020a170902f78d00b0014d522edeb3mr19824683pln.173.1650452249631; Wed, 20
Apr 2022 03:57:29 -0700 (PDT)
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: <CAD+b3HgQmmHgSsfh5r28QoQh-OyH7VxMZVQ8RYcUMmK7_U6b2Q@mail.gmail.com>
 by: Sam Ezeh - Wed, 20 Apr 2022 10:57 UTC

Hello everyone,

Has anyone here used or attempted to use a nested class inside an enum?

If so, how did you find it? (what did you expect to happen and did
your expectations align with resulting behaviour etc.)

Here are two examples describing the situation I'm talking about

```
class Outer(Enum):
a = 1
b = 2
class Inner(Enum):
foo = 10
bar = 11
```

```
class Outer(Enum):
a = 1
b = 2
class Inner:
c = None
def __init__(self):
....
```

Kind Regards,
Sam Ezeh

Re: Enums and nested classes

<jce2gbFdtcvU2@mid.individual.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: greg.ew...@canterbury.ac.nz (Greg Ewing)
Newsgroups: comp.lang.python
Subject: Re: Enums and nested classes
Date: Fri, 22 Apr 2022 10:00:43 +1200
Lines: 12
Message-ID: <jce2gbFdtcvU2@mid.individual.net>
References: <CAD+b3HgQmmHgSsfh5r28QoQh-OyH7VxMZVQ8RYcUMmK7_U6b2Q@mail.gmail.com>
<mailman.164.1650452253.20749.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net rOADijh+GkI2DhRhzGQWmQRz0dKAxUtmMUqOytOlQls6RdXSu0
Cancel-Lock: sha1:lhUglrDdlogBvNOzlilmsqoloMU=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:91.0)
Gecko/20100101 Thunderbird/91.3.2
Content-Language: en-US
In-Reply-To: <mailman.164.1650452253.20749.python-list@python.org>
 by: Greg Ewing - Thu, 21 Apr 2022 22:00 UTC

On 20/04/22 10:57 pm, Sam Ezeh wrote:
> Has anyone here used or attempted to use a nested class inside an enum?
>
> If so, how did you find it? (what did you expect to happen and did
> your expectations align with resulting behaviour etc.)

That's a pretty open-ended question. Is there something about
its current behaviour that you think should be different?

--
Greg

Re: Enums and nested classes

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: eth...@stoneleaf.us (Ethan Furman)
Newsgroups: comp.lang.python
Subject: Re: Enums and nested classes
Date: Thu, 21 Apr 2022 19:19:36 -0700
Lines: 17
Message-ID: <mailman.188.1650593986.20749.python-list@python.org>
References: <CAD+b3HgQmmHgSsfh5r28QoQh-OyH7VxMZVQ8RYcUMmK7_U6b2Q@mail.gmail.com>
<mailman.164.1650452253.20749.python-list@python.org>
<jce2gbFdtcvU2@mid.individual.net>
<d7f8dceb-da78-a714-a963-3ccdaa16ca1d@stoneleaf.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de SwFBmYDKTSk8uKn2pqvREAcqmJiGIeWEfLv7niNhWCaA==
Return-Path: <ethan@stoneleaf.us>
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=stoneleaf.us header.i=@stoneleaf.us header.b=pod/kxpV;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'fairly': 0.05; ';-)':
0.07; 'happened': 0.07; 'received:217.70': 0.09;
'received:gandi.net': 0.09; 'received:mail.gandi.net': 0.09;
'behaviour': 0.16; 'easily.': 0.16; 'from:addr:ethan': 0.16;
'from:addr:stoneleaf.us': 0.16; 'from:name:ethan furman': 0.16;
'greg': 0.16; 'indeed': 0.16; 'message-id:@stoneleaf.us': 0.16;
'nested': 0.16; 'practice,': 0.16; 'subject:nested': 0.16;
'surprising.': 0.16; 'theory.': 0.16; '~ethan~': 0.16; 'wrote:':
0.16; 'it?': 0.19; 'pm,': 0.19; 'to:addr:python-list': 0.20;
'anyone': 0.25; 'behavior': 0.26; 'bit': 0.27; 'expect': 0.28;
'folks': 0.28; 'header:User-Agent:1': 0.30; 'think': 0.32;
'question': 0.32; 'there': 0.33; 'header:In-Reply-To:1': 0.34;
'question.': 0.35; "we're": 0.35; 'change': 0.36; 'using': 0.37;
'class': 0.37; 'way': 0.38; 'means': 0.38; 'use': 0.39; 'happen':
0.40; 'something': 0.40; 'should': 0.40; 'here': 0.62; 'your':
0.64; 'received:217': 0.67; 'resulting': 0.70
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stoneleaf.us;
s=gm1; t=1650593978;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references;
bh=dHFjZNno3xzqSBmlrLiuri3XsrnHInv0I5xhfQ9RpY0=;
b=pod/kxpV5Wn5FFwuK+X+/KUqbFyy55AcgMZq+v/ryCYXgGMs2yjTX5jJdi2gcODcaj8CXp
PTwcO1XQb1AJLhYDOZq0HJb1lM4G0M3jkJiOMfRtjZgtjfH6+rxgCgWm4cefunQ+2hJ3j0
u8ygqS5YjhrFMCR7okMYlRin5ZDLinoYg2dlW96Mt8MMLaoDksFh+ROyKWKhm4vRZNH9T4
XqhqI1jzm+A84miv3eQqEQTxLGkKqG97doQQa/iMbSL1YuuOcG8+DsLi2DjHU6VnTVHC0R
QKmHDMkpviHQQSvtikWohgLG7p4JDdzNmTKrkExHxdULfYCFWbUR6sY0AATa1w==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Content-Language: en-US
In-Reply-To: <jce2gbFdtcvU2@mid.individual.net>
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: <d7f8dceb-da78-a714-a963-3ccdaa16ca1d@stoneleaf.us>
X-Mailman-Original-References: <CAD+b3HgQmmHgSsfh5r28QoQh-OyH7VxMZVQ8RYcUMmK7_U6b2Q@mail.gmail.com>
<mailman.164.1650452253.20749.python-list@python.org>
<jce2gbFdtcvU2@mid.individual.net>
 by: Ethan Furman - Fri, 22 Apr 2022 02:19 UTC

On 4/21/22 15:00, Greg Ewing wrote:
> On 20/04/22 10:57 pm, Sam Ezeh wrote:
>> Has anyone here used or attempted to use a nested class inside an enum?
>>
>> If so, how did you find it? (what did you expect to happen and did
>> your expectations align with resulting behaviour etc.)
>
> That's a pretty open-ended question. Is there something about
> its current behaviour that you think should be different?

Indeed -- the point of the question is to (hopefully) find out what folks have already tried, and whether they found the
current behavior surprising. We're looking for what happened in practice, not for what should happen in theory. ;-)

And of course, no one using enums that way means we can change how that bit works fairly easily.

--
~Ethan~

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor