aspose file tools
The moose likes Jython/Python and the fly likes OO in Python Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Languages » Jython/Python
Reply Bookmark "OO in Python" Watch "OO in Python" New topic
Author

OO in Python

Robert Hill
Ranch Hand

Joined: Feb 24, 2006
Posts: 94
Is there any encapsulation in python objects?

There is the convention to use a single underscore to denote private members, but is not enforced in any way.

Using double underscore mangles it a bit, but is used to avoid naming conflicts.

It seems like python OO is like faking OO in C.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

The forum right below this one (Object Oriented Scripting) has Python as one of its subjects. So I'll move this post down there.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8264

Originally posted by Robert Hill:

It seems like python OO is like faking OO in C.


Yes, some of Python's object support is by convention rather than forced on you by the language, but you have to appreciate that Python is ment to be a lighter-weight language than, say Java, from a syntax point of view. If you want strict OO features, use Smalltalk. If you want to write something quick and dirty, use a scripting language. If you want a good balance between those two extremes, Python makes a good compromise.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: OO in Python
 
Similar Threads
i need to know this, please, can you answer this questions and be fair
Suggested File Name Problem in Downloading
why python ?
JAVA is a pure OO language?
Java Coding Standards