[Tutor] How arguments to the super() function works?

Alan Gauld alan.gauld at yahoo.co.uk
Sat May 18 15:13:44 EDT 2019


On 18/05/2019 17:21, Arup Rakshit wrote:

> class Role(db.Model):
> 
>     def __init__(self, **kwargs):
>         super(Role, self).__init__(**kwargs)
> 
> Here, why super(Role, self).__init__(**kwargs) is used instead 
> of super().__init__(**kwargs) ? 

I suspect you are reading an older tutorial. It used to be the
case that you had to provide the class and instance values to
super() but that's no longer needed in the latest versions.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list