Top "Class" questions

A template for creating new objects that describes the common state(s) and behavior(s). NOT TO BE CONFUSED WITH CSS CLASSES.

Python function overloading

I know that Python does not support method overloading, but I've run into a problem that I can't seem to …

python class oop overloading multiple-dispatch
Find a class somewhere inside dozens of JAR files?

How would you find a particular class name inside lots of jar files? (Looking for the actual class name, not …

java class jar project-structure text-search
AttributeError: 'datetime' module has no attribute 'strptime'

Here is my Transaction class: class Transaction(object): def __init__(self, company, num, price, date, is_buy): self.company = company …

python class python-2.7
UML class diagram enum

I am modeling a class diagram. An attribute of a class is an enumeration. How do I model this? Normally …

class enums uml diagram
Difference between 'cls' and 'self' in Python classes?

Why is cls sometimes used instead of self as an argument in Python classes? For example: class Person: def __init__(…

python class object terminology self
c++ "Incomplete type not allowed" error accessing class reference information (Circular dependency with forward declaration)

Had some issues in my code recently surrounding what I now know of as a Circular dependency. In short there …

c++ class reference forward-declaration
How to create a custom string representation for a class object?

Consider this class: class foo(object): pass The default string representation looks something like this: >>> str(foo) "&…

python class
How to implement private method in ES6 class with Traceur

I use Traceur Compiler to have advantage with ES6 features now. I want to implement this stuff from ES5: function …

javascript class ecmascript-5 ecmascript-6 traceur
Is it possible to make abstract classes in Python?

How can I make a class or method abstract in Python? I tried redefining __new__() like so: class F: def __…

python class inheritance abstract-class abstract