1

My understanding of python is limited. In a different forum, someone asked about classes. In my explanation, I said Classes contain 3 things: properties, methods, and events. While several agreed with my comment, one person said I was wrong, that python classes do not contain events. So my question is simple. Do/can python classes contain events?

thank for taking the time to set me straight.

1
  • 2
    In Python use the term attributes or maybe data members. Reserve the use of the property term for when you implement a real property, usually with the decorator syntax @property Commented Jan 31, 2019 at 16:08

1 Answer 1

2

Python classes have methods and properties.

Events can be implemented in Python using the Observer pattern.

This blog has a nice example of implementing events in Python. https://sourcemaking.com/design_patterns/observer/python/1

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.