What is the difference between old style and new style classes in python?



What is the difference between old style and new style classes in python?..

Answer / Robin Kumar

Old-style classes do not have a `__init__` method by default and inherit from `object`. New-style classes have a `__bases__` attribute and are derived from `object`. Python 2.2 introduced new-style classes to eliminate inconsistencies between old and new objects.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is used to represent Strings in Python? Is double quotes used for String representation or single quotes used for String representation in Python?

1 Answers  


Mention what is flask-wtf and what are their features?

1 Answers  


What is lambda?

1 Answers  


What is metaprogramming in Python?

1 Answers  


How do you sort in descending order in python?

1 Answers  


Are sets hashable python?

1 Answers  


Does python support interfaces like java does?

1 Answers  


What is a control flow statement?

1 Answers  


What are python slots?

1 Answers  


What does end do in python?

1 Answers  


Is c++ required for learning python?

1 Answers  


What is the process of pickling and unpicling?

1 Answers  


Categories