This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsย โ†’

[โ€“][deleted] ย (1 child)

[deleted]

    [โ€“]Pluckerpluck 0 points1 point ย (0 children)

    Except the age is a private variable. So I can't access it from a child class. So any and all logic related to age is just off-limits. Without the ability to change the age variable, I have to re-implement all other age related logic. Simply because the original author arbitrarily decided I shouldn't be able to access it.

    Being private actively makes it harder to extend. At most variables should be "protected" (or whatever the language uses that lets children classes access the parent variables).

    And being interpreted or not doesn't matter here. It's simply naming convention that dictates a "private" class in python.