Re: Trailer for upcoming Python documentary

2025-05-19 Thread Christian Buhtz via Python-list
Am 18.05.2025 22:16 schrieb Larry Martell via Python-list: https://youtu.be/pqBqdNIPrbo?si=P2ukSXnDj3qy3HBJ Awesome! Which release channels will be used? How can we pay? -- https://mail.python.org/mailman/listinfo/python-list

Dynamic classes

2025-05-19 Thread Jonathan Gossage via Python-list
I have created a dynamic class using the type() function: x = type('MyFlags', (), {'Flag1': 1, 'Flag2': 2, 'Flag3: 4, ' '__init__' : __init__}) The new class is there, and the class variables, Flag1, Flag2, and Flag3, are present correctly. However, when I try to create an instance of this class wi

Re: Dynamic classes

2025-05-19 Thread Mats Wichmann via Python-list
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__}) The new class is there, and the class variables, Flag1, Flag2, and Flag3, are present correctly

Re: Dynamic classes

2025-05-19 Thread Thomas Passin via Python-list
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__}) The new class is there, and the c

Re: Dynamic classes

2025-05-19 Thread Rob Cliffe via Python-list
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,

Re: Dynamic classes

2025-05-19 Thread Greg Ewing via Python-list
On 20/05/25 4:33 am, Stefan Ram wrote: So, the reason you're getting that TypeError is your __init__ function isn't actually hooked up right when you build your class with "type". You got to set up your init before you call "type", and then drop it into the class dictionary as a /f