Calling super() is easier

The simpler call to super(), without any arguments, will save you some typing in Python 3:

Python 2

Python 3

class CoolMixin(object):   
 
    def do_it(self):   
        return super(CoolMixin,    
                  self).do_it()   
class CoolMixin:

def do_it(self):
return super().do_it()

 

Specifying the class name and instance is optional, thereby making your code DRY and less prone to errors while refactoring.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.165.246