Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #197484

Re: Dynamic classes

From Rob Cliffe <rob.cliffe@btinternet.com>
Newsgroups comp.lang.python
Subject Re: Dynamic classes
Date 2025-05-19 23:29 +0100
Message-ID <mailman.66.1747693965.3008.python-list@python.org> (permalink)
References <CAApdmf3UwA6zf2-eSfd=1U=Unx3-6PUj6+XS0Sp62rkn73C8iQ@mail.gmail.com> <385fb601-4061-4785-809a-94ee1e6c4e11@wichmann.us> <1139f617-1f4e-4ccc-bbfe-bd8bf0ef02e3@tompassin.net> <229045eb-9273-47b5-b265-298ce67edff3@btinternet.com>

Show all headers | View raw



On 19/05/2025 23:11, Thomas Passin via Python-list wrote:
> On 5/19/2025 5:49 PM, Mats Wichmann via Python-list wrote:
>> On 5/19/25 09:51, Jonathan Gossage via Python-list wrote:
>>> I have created a dynamic class using the type() function:
>>> x = type('MyFlags', (), {'Flag1': 1, 'Flag2': 2, 'Flag3: 4, ' 
>>> '__init__' :
>>> __init__})
This is not my area of expertise, but there is a misplaced quote before
     '__init__'
that should be after
     'Flags3
Correct this, and your example runs without error.
Best wishes
Rob Cliffe

Back to comp.lang.python | Previous | Next | Find similar


Thread

Re: Dynamic classes Rob Cliffe <rob.cliffe@btinternet.com> - 2025-05-19 23:29 +0100

csiph-web