Skip to content
Discussion options

You must be logged in to vote

The suggestion is just to follow the Python standard that private attributes that are not meant to be part of the public interface of a class should use a _. This is to indicate to the developers that they should not be called by users or other classes, but only internally in the same class.

The attributes that are part of the public interface should have no underscore. For cases where the attribute should be read only or you need some logic in the setter (for example to validate the data before changing it) you would make a private attribute and combine it with a property for implementing the getter/setter functionality.

For your example I imagine that n_step and n_avg_meas probably can …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@TeresiaOlsson
Comment options

TeresiaOlsson May 6, 2026
Maintainer Author

@TeresiaOlsson
Comment options

TeresiaOlsson May 7, 2026
Maintainer Author

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@TeresiaOlsson
Comment options

TeresiaOlsson May 29, 2026
Maintainer Author

Answer selected by gubaidulinvadim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants