the.bay.news

Sentinal with attributes

Discussions on Python.org
Sentinal with attributes
I’ve got a situation, and the ‘obvious’[1] solution would be a Sentinal class with attributes. Context: We’ve got a code system where depending on the settings, some parts of the code might or might not run. So for example, we have class Settings(): coloc: ColocationSettings | None and code that requires the value of settings.coloc.forecast only makes sense to run when colocation is enabled, so such code blocks are behind if settings.coloc is not None: guards. Which both makes sense and kee...

I’ve got a situation, and the ‘obvious’[1] solution would be a Sentinal class with attributes. Context: We’ve got a code system where depending on the settings, some parts of the…

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.