Objects in python !!

Python logo

Python

While learning Python I come to know a strange thing about Python that everything in python is an object. There is nothing which is not object.

Still, this begs the question. What is an object? Different programming languages define “object” in different ways.

In some, it means that all objects must have attributes and methods; in others, it means that all objects are subclassable. In Python, the definition is looser; some objects have neither attributes nor methods, and not all objects are subclassable. But everything is an object in the sense that it can be assigned to a variable or passed as an argument to a function.

This is so important that I’m going to repeat it in case you missed it the first few times: everything in Python is an object. Strings are objects. Lists are objects. Functions are objects. Even modules are objects.

Advertisements

About bijolianabhi

Graduate from Engineering College Bikaner, India in 2010 and working as Open Source activist. I love programming and implementing interesting ideas. I have interest in Mozilla Firefox extension development. I am currently learning basics of python to develop some interesting applications.
This entry was posted in Programming, Python and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s