Re: Name mangling vs qualified access to class attributes

2016-12-15 Thread Marco Paolieri
Hi all, Thank you for the feedback. So, to recap, reasons to use name mangling 'self.__update(iterable)' rather than qualified access 'Mapping.update(self, iterable)' are: 1. Qualified access stops working when class 'Mapping' is renamed (at compile-time) or its name is reassigned at runtime. H

Re: Name mangling vs qualified access to class attributes

2016-12-14 Thread Steve D'Aprano
On Wed, 14 Dec 2016 07:27 am, paoli...@gmail.com wrote: > The official Python tutorial at > > https://docs.python.org/3/tutorial/classes.html#private-variables > > says that "name mangling is helpful for letting subclasses override > methods without breaking intraclass method calls" and makes an

Re: Name mangling vs qualified access to class attributes

2016-12-14 Thread dieter
paoli...@gmail.com writes: > The official Python tutorial at > > https://docs.python.org/3/tutorial/classes.html#private-variables > > says that "name mangling is helpful for letting subclasses override methods > without breaking intraclass method calls" and makes an interesting example: > > clas

Re: Name mangling vs qualified access to class attributes

2016-12-13 Thread Cameron Simpson
On 13Dec2016 12:27, paoli...@gmail.com wrote: The official Python tutorial at https://docs.python.org/3/tutorial/classes.html#private-variables says that "name mangling is helpful for letting subclasses override methods without breaking intraclass method calls" and makes an interesting example

Name mangling vs qualified access to class attributes

2016-12-13 Thread paolieri
The official Python tutorial at https://docs.python.org/3/tutorial/classes.html#private-variables says that "name mangling is helpful for letting subclasses override methods without breaking intraclass method calls" and makes an interesting example: class Mapping: def __init__(self, iterabl