2 ms·
> Python forces you to write readable code. Even in the REPL, which is extremely annoying. To this date Python REPL examples tend to have this kind of artifica
by lifthrasiir 5y ago
> Python forces you to write readable code.
Even in the REPL, which is extremely annoying. To this date Python REPL examples tend to have this kind of artifical comments (quoting from [1]):
>>> class Weekday(Enum):
... MONDAY = 1
... TUESDAY = 2
... WEDNESDAY = 3
... THURSDAY = 4
... FRIDAY = 5
... SATURDAY = 6
... SUNDAY = 7
... #
... @classmethod
... def from_date(cls, date):
... return cls(date.isoweekday())
Enforcing indentation is generally a good thing, but it should be possible to switch it off or loosen it up when it ceases to be good. Which is impossible with a Python-like indentation-only syntax.
[1] https://docs.python.org/3.11/howto/enum.html#basic-enum-tutorial https://docs.python.org/3.11/howto/enum.html#basic-enum-tuto...