- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
- Python Advanced Tutorial
- Python - Classes/Objects
- Python - Reg Expressions
- Python - CGI Programming
- Python - Database Access
- Python - Networking
- Python - Sending Email
- Python - Multithreading
- Python - XML Processing
- Python - GUI Programming
- Python - Further Extensions
How do you compare Python objects with .NET objects?
By default, all .NET objects are reference types and their equality and hash code is determined by their memory address. Additionally, assigning a variable to an existing object just makes it point to that address in memory, so there is no costly copying occurring. It appears that this is true for python objects as well to certain extent.
Properties of Python objects: All python objects have
a unique identity (an integer, returned by id(x)); a type (returned by type(x))
You cannot change the identity; You cannot change the type.
Some objects allow you to change their content (without changing the identity or the type, that is).
Some objects don’t allow you to change their content.
The type is represented by a type object, which knows more about objects of this type.
- Related Articles
- How do you implement persistent objects in Python?
- How Can You Copy Objects in Python?
- Do you think garbage collector can track all the Python objects?
- How do you pass objects by reference in PHP 5?
- How exactly do Python functions return/yield objects?
- How to access Python objects within objects in Python?
- How we can convert Python objects into JSON objects?
- How do StringDtype objects differ from object dtype in Python Pandas?
- How do you calculate Net Current Assets Turnover?
- How do we copy objects in java?
- Compare two objects of Character type in Java