Charles-François Natali <cf.natali at gmail.com> writes: > 2014-03-15 21:44 GMT+00:00 Nikolaus Rath <Nikolaus at rath.org>: > >> Guido van Rossum <guido at python.org> writes: >> > This downside of using subclassing as an API should be well known by now >> > and widely warned against. >> >> It wasn't known to me until now. Are these downsides described in some >> more detail somewhere? >> > > The short version is: "inheritance breaks encapsulation". > > As a trivial and stupid example, let's say you need a list object which > counts the number of items inserted/removed (it's completely stupid, but > that's not the point :-): > > So you might do something like: [...] Very illuminating example, thanks a lot! Best, -Nikolaus -- Encrypted emails preferred. PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C »Time flies like an arrow, fruit flies like a Banana.«
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4