109
Debugging (lemmy.ml)
you are viewing a single comment's thread
view the rest of the comments
[-] TheDoctor@hexbear.net 2 points 1 week ago

In the way that’s common in languages like Java where you’re making a property read-only, yes. But there’s a whole protocol in Python called descriptors where you can override the . on a field. The most common form of these is class methods annotated with the @property annotation, which makes it so the method can be accessed as if it were a property.

this post was submitted on 04 Nov 2024
109 points (96.6% liked)

Programmer Humor

32469 readers
661 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS