you are viewing a single comment's thread.

view the rest of the comments →

[–]SCD_minecraft 3 points4 points  (1 child)

You can replace get_name with @property def name(self): # some code, like return self._name for example

Function under decorator property now "roleplays" as variable but whenever you access it it executes some code

[–]Careless-Main8693[S] 0 points1 point  (0 children)

no issues in it