-
Notifications
You must be signed in to change notification settings - Fork 0
Class Methods
Vinicius Reif Biavatti edited this page Jul 25, 2022
·
3 revisions
- Always use "cls" as the first argument
- Use the @classmethod decorator
- Do not need to set type hint for "cls" variable
✅ Do
class Person:
@classmethod
def create(cls, name: str) -> 'Person':
...
- Home
- Structural Naming Conventions
- Format Conventions
- Code Naming Conventions
- Inheritance
- Access Modifiers
- Importation
- Functions and Methods
- Documentation
- Resources