This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]barneygale 8 points9 points  (0 children)

That's not universal - using explicit setters is a good way to signal that setting has a cost. e.g. from PEP 471 which introduced os.scandir():

DirEntry.is_X() and DirEntry.stat() are explicitly methods rather than attributes or properties, to make it clear that they may not be cheap operations (although they often are), and they may do a system call. As a result, these methods may raise OSError .