Classes/Objects
Programming for Animation Devblog » Devlog
Classes are constructors that are used as a template to build objects.
Classes are defined with the class keyword, followed by the classes name.
Classes use the __init__() function to assign values to object properties.
Classes use the __str__() function to control what is returned when the object is represented as a string.
Methods in the context of objects refer to a function within an object, that belongs to and is contained by the object.
Self refers to the current instance of a class and is used to access its variables. It does not have to be called self, but usually is, so use it for clarity.
Objects and their properties can be deleted with the del keyword, and modified with =.
Programming for Animation Devblog
Status | In development |
Category | Other |
Author | phocion1 |
More posts
- OperatorsDec 16, 2022
- Python in MayaDec 16, 2022
- Variables and Data Types ContinuedDec 16, 2022
- FunctionsDec 16, 2022
- Data TypesDec 16, 2022
- VariablesOct 10, 2022
Leave a comment
Log in with itch.io to leave a comment.