Skip to content

Commit

Permalink
30. Low memory cost
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohabdo21 committed Nov 28, 2023
1 parent e75a1a5 commit 974aa6d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion 0x09-python-everything_is_object/101-locked_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,17 @@


class LockedClass:
__slots__ = ['first_name']
"""
Prevents the user from dynamically creating new instance attributes,
except if the new instance attribute is called first_name.
Attributes:
first_name (str): first name.
"""

__slots__ = ["first_name"]

def __init__(self):
"""Creates new instances of Locked Class."""

self.first_name = "first_name"

0 comments on commit 974aa6d

Please sign in to comment.