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
Design Computing: 3D Modeling in Rhinoceros with Python/RhinoscriptUniversity of Michigan via Coursera A Practical Introduction to Test-Driven Development
LearnQuest via Coursera FinTech for Finance and Business Leaders
ACCA via edX Access Bioinformatics Databases with Biopython
Coursera Project Network via Coursera Accounting Data Analytics
University of Illinois at Urbana-Champaign via Coursera