Re: Dynamic classes
Rob Cliffe via Python-list <[email protected]>
| Newsgroups | gmane.comp.python.general |
|---|---|
| Message-ID | <[email protected]> |
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
--
https://mail.python.org/mailman/listinfo/python-list