Closed angel-carvajal-coder closed 3 years ago
The following code in the dived_by method in episodes 3-14 is non-pythonic and can be fixed Sorry if I'm rude: I'm new to GitHub:
dived_by
if other.value == 0: return None, RTError( other.pos_start, other.pos_end, 'Division by zero', self.context ) return Number(self.value / other.value).set_context(self.context), None
to
try: return Number(self.value / other.value).set_context(self.context), None except ZeroDivisionError: return None, RTError( other.pos_start, other.pos_end, 'Division by zero', self.context )
And this is an issue because...?
...Zero division check is non-pythonic!
Anyway, I realized the repository was "archived", so I'm gonna close this issue
The following code in the
dived_by
method in episodes 3-14 is non-pythonic and can be fixed Sorry if I'm rude: I'm new to GitHub:to