CSE-30-01
Lecture 3: Classes
Skip To Content
Dashboard
  • Login
  • Dashboard
  • Calendar
  • Inbox
  • History
  • Help
  • Resources
Close
  • My Dashboard
  • CSE-30-01
  • Pages
  • Lecture 3: Classes
2021 Winter Quarter
  • Home
  • Pages
  • Quizzes
  • Syllabus
  • NameCoach
  • Zoom
  • YuJa
  • Gradescope
  • SETS
View All Pages

Lecture 3: Classes

In this lecture, we will do an in-depth review of classes. I prepared a review notebook on classes Links to an external site., and I would advise you to read it before class.

You can also read the official Python classes tutorial Links to an external site..

The topics we will cover include:

  • Basic class definition Links to an external site.
  • Instances Links to an external site., methods Links to an external site., and properties Links to an external site.
  • Static methods Links to an external site. and class methods Links to an external site.
  • Subclasses Links to an external site.
  • isinstance Links to an external site., issubclass Links to an external site.
  • dir() of a class Links to an external site.
  • getattr Links to an external site., setattr Links to an external site.
  • Adding methods to an existing class
  • Giving a meaning to arithmetic operators Links to an external site.: __add__, __mul__, etc.
  • Equality and ordering Links to an external site.
  • Implementing a dictionary: __setitem__, __getitem__, etc. Links to an external site.
  • Using the object in dictionary and sets: hashing Links to an external site.
  • Implementing context managers Links to an external site.

Here is the notebook presented in class Links to an external site.. 

Class Video:

Requirements Changed