👩💻 Join our community of thousands of amazing developers!
TL;DR Implementation of rust style enums in Python: rust_enum Encountering the issue Today I was working on an AI module in my pet gamedev project and encountered a problem with magic constants. Look: def try_producing_target(self, subject, perception): if self.subject is None: return False # what does False mean? if abs2(sub2(subject.p, self.subject.p)) <= self.d: return None # what is the difference with None? if self.period.step(): return self.subject.p return False...