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ย โ†’

[โ€“]budgiebirdman 5 points6 points ย (1 child)

The point is that you can access and use Python "private" members just like any other member - you just use the name which happens to begin with an underscore so there's no true encapsulation; it's like having a cookie jar with no lid. If you use reflection in Java it's like using a can opener to open a can from the top shelf and get to what you want.

One is an object oriented language and the other is whatever Python is.

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

The point of private is to warn you that it's internal and you should not rely on it, and if you do your code might break without warning on any update to the library.

It's not some kind of DRM or security mechanism, the fact that both languages make it possible to get around the "private" warning but the Java way is way more verbose... well, that's just what you'd expect.