+ 3
Please note for next time that this is something you would post on your community feed. This is a Question and Answer section, but you simply put a statement for awareness.
19th Oct 2022, 12:59 PM
Justice
Justice - avatar
+ 2
But doing it this way will be hard for maintenance because you have to go all over your code to find your class definition. It will be very messy...
19th Oct 2022, 12:20 PM
Bob_Li
Bob_Li - avatar
+ 2
lambda expressions are useful because it avoids defining functions for simple task, such as map and filtering. But simple classes have limited usefulness. Maybe that's why people don't use it often. From what I read after Googling c# anonymous class, they seem to work like structs in c++, for creating composite data types. Perhaps they can be useful.
19th Oct 2022, 12:32 PM
Bob_Li
Bob_Li - avatar
+ 1
belal bayrakdar Perhaps you could edit your original post to: "How do you use type() to create classes?" ...then it would not be out of place in the Q&A Discussions..😁 It's a good topic.
20th Oct 2022, 1:46 AM
Bob_Li
Bob_Li - avatar
+ 1
On a side note, Python have SimpleNamespace which allows you to use the dot notation on dictionaries. Not OOP, but close enough.
20th Oct 2022, 1:51 AM
Bob_Li
Bob_Li - avatar