Bring Your Logic using Python
341 subscribers
109 photos
1 video
4 files
544 links
Logic building using Python : Materials, links, e-books and Code snippets
Download Telegram
#Tips

You can use type() to dynamically create a new class:

NewType = type("NewType", (object,), {"a": 1, "b": 2})
n = NewType()

is the same as

class NewType(object):
a = 1
b = 2

n = NewType()
Python Clean Code Tip:

Use how and when to use decorators