Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is a descriptor in Python?
Think about what controls access to attributes.
What do the set and delete methods do?
Consider what happens to a value when it is deleted.
What method retrieves an attribute's value in a descriptor?
Focus on the method names.
T/F: The set method is used to delete an attribute.
Consider what each method is designed to do.
Create a descriptor that raises an exception if a set value is not an integer.
Use isinstance to check the type of the value.
Develop a class with multiple descriptors managing distinct attributes with different constraints.
Consider the use of a Typed descriptor to enforce specific types.
6 more questions in this section. Enroll free to practise them all.
Enroll free