0

I couldn't understand how to inherit from built-in list class in python and how does johny has access to functionality of list.

class Namedlist(list) : def __init__(self, a_name): list__init__([]) self.name=a_name johny=Namedlist("John") dir(johny) >>'append', 'extend'....

6th Feb 2019, 4:07 PM
Vedant Bhosale
1 Resposta
0
Please don't post the same question several times; either erase this one or the other.
6th Feb 2019, 4:42 PM
HonFu
HonFu - avatar