Understanding Attributes - They're Not Nearly as Boring as You Think
Offered By: PyCon US via YouTube
Course Description
Overview
Syllabus
Intro
I teach Python!
Let's assign to a variable!
Let's get fancier
Variables vs. attributes
Reading from attributes
Setting attributes
We set attributes all the time
What's missing from this program?
Idea: A global variable
A better alternative
This is pretty ugly
What will this code print?
The answer
Methods are class attributes
Classes are file-less modules
Class attribute, nicer edition
Static variables.!?
Let's walk through this
A new version of Person
We need a new class
Does it work?
Try again, but with inheritance
Let's use inheritance
Better use of inheritance
The problem?
Solution: Explicitly call Person.init
Better: Use super
Printing our objects
Operator overloading
Something is still missing
Example
Use it in a class attribute
Retrieve the value
What are gets parameters?
Methods are descriptors
Where is our original function?
Taught by
PyCon US
Related Courses
Introduction à la programmation orientée objet (en Java)École Polytechnique Fédérale de Lausanne via Coursera Useful Genetics Part 2
The University of British Columbia via Coursera Object-Oriented Programming
Indian Institute of Technology Bombay via edX Java für Einsteiger
openHPI Computing: Art, Magic, Science - Part II
ETH Zurich via edX