Python-patterns – A collection of design patterns/idioms in Python
I wish there was a pattern to encapsulate data and functions from a module.So you could do:    import greeter

    greet1 = encapsulate(greeter)
    greet2 = encapsulate(greeter)

    greet1.name = 'Joe'
    greet2.name = 'Sue'

    greet1.greet()
    greet2.greet()

And greeter.py would look like this:    name = 'nobody'
    
    def greet():
        print ('Hello '+name)

Output:    Hello Joe
    Hello Sue

This would be so much nicer and leaner than classes.