About 165,000 results
Open links in new tab
  1. What is the difference between objects and classes in Python?

    I was wondering what is the difference between objects and classes in python? I thought all classes are objects, but in that case, author wouldn't have used phrase "classes and objects".

  2. When should I be using classes in Python? - Stack Overflow

    Oct 12, 2015 · In python the simple heuristic for when you should use a class comes down to whether or not your abstraction needs to be concerned with state. Abstractions that carry …

  3. python - How to create a list of objects? - Stack Overflow

    Aug 15, 2020 · 5 The Python Tutorial discusses how to use lists. Storing a list of classes is no different than storing any other objects.

  4. python - How to print instances of a class using print ... - Stack …

    A simple decorator @add_objprint will help you add the __str__ method to your class and you can use print for the instance. Of course if you like, you can also use objprint function from the …

  5. Difference between Module and Class in Python - Stack Overflow

    Aug 24, 2022 · From a Java perspective, classes are not all that different here. Modules can contain more than just one class however; functions and any the result of any other Python …

  6. python - are user defined classes mutable - Stack Overflow

    Aug 22, 2012 · All objects (with the exception of a few in the standard library, some that implement special access mechanisms using things like descriptors and decorators, or some …

  7. class - Why do Python classes inherit object? - Stack Overflow

    Apr 9, 2022 · The answer to this question (while simple) is quite difficult to find. Googling things like "python object base class" or similar comes up with pages and pages of tutorials on object …

  8. How to create multiple class objects with a loop in python?

    Suppose you have to create 10 class objects in python, and do something with them, like:

  9. Implementing use of 'with object() as f' in custom class in python

    Sep 23, 2010 · I have to open a file-like object in python (it's a serial connection through /dev/) and then close it. This is done several times in several methods of my class.

  10. oop - What is an Object in Python? - Stack Overflow

    May 26, 2019 · In the context of Python and all other Object Oriented Programming (OOP) languages, objects have two main characteristics: state and behavior. You can think of a …