idaholab / MontePy

MontePy is the most user friendly Python library (API) to read, edit, and write MCNP input files.
https://www.montepy.org/
MIT License
32 stars 7 forks source link

Implement __slots__ to avoid user confusion #508

Open MicahGale opened 3 months ago

MicahGale commented 3 months ago

Discussed in https://github.com/idaholab/MontePy/discussions/345

Originally posted by **MicahGale** August 2, 2023 TIL about slots in python: https://stackoverflow.com/questions/472000/usage-of-slots Basically statically allocating python attributes. The benefit would be to guard against typos frustrating users. For instance `cell.materail = mat`.