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

    Yes, classes (and functions, and modules, and basically everything) in Python are objects, too. The difference lies in their types: class Foo(object): pass print type(Foo) print type(Foo()) To …

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

    May 26, 2019 · Objects are Python’s abstraction for data. All data in a Python program is represented by objects or by relations between objects. (In a sense, and in conformance to …

  3. python - How to Link Multiple Classes Together Efficiently - Stack …

    May 13, 2014 · Problem: Well, since many classes have to be linked to others, it became hard after a while to figure out which class to load first in order to assign variables. Furthermore, …

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

    Aug 15, 2020 · We have class for students and we want make list of students that each item of list is kind of student. class student : def __init__(self,name,major): self.name=name …

  5. python - Compare object instances for equality by their attributes ...

    pickle is a very common serialization lib for Python objects, and will thus be able to serialize pretty much anything, really. In the above snippet, I'm comparing the str from serialized a with the …

  6. python - Creating a static class with no instances - Stack Overflow

    May 31, 2015 · The Pythonic way to create a static class is simply to declare those methods outside of a class (Java uses classes both for objects and for grouping related functions, but …

  7. class - Python object interaction - Stack Overflow

    Dec 31, 2016 · You've misunderstood how python works. Until two is assigned, you cannot call two.var2 = 5. But you call that while you are instantiating (two = Two()), so the object you are …

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

    Here I have appended the objects in a list and then you can use the object outside the loop any were. Sorry but my solution is no different then others. – Tanveer Alam

  9. python - "Enabling" comparison for classes - Stack Overflow

    It is on classes/objects, and it's a simple class on defining a circle, with the name class Circle(object). The exact text of the HW (I completed the first two parts of this hw and thus this …

  10. Python: Sharing variables between classes/objects - Stack Overflow

    Jan 16, 2017 · That's a whole new question. 1. Actually do the entire Python tutorial. 2. Search for "Python Instance Variable". 3. Ask the question again, after doing the entire tutorial and …

Refresh