On 2020-04-08 10:22 a.m., Soni L.
On 2020-04-08 10:12 a.m., Joao S. O.
On 8/04/20 1:14 pm,
Soni L. wrote:
> def get_property_values(self, prop):
> factory =
> except KeyError with keyerror_handler;
> iterator = factory(self._obj)
> first = next(iterator)
> except abdl.exceptions.ValidationError with
> except StopIteration with stop_handler as
> return itertools.chain([first], iterator)
I don't think special syntax is warranted for this. You
first = next(iterator)
except abdl.exceptions.ValidationError as e:
except StopIteration as e:
I agree - and this is far more readable than any
of the propositions so far. (Like, for an order of
I'd wait for Soni to try to explain why this would not
fit his use case, before proceeding with the
have you looked at the syntax highlighting of the thing?
it sees keywords *everywhere* (which is right) it's basically
unmaintainable. having the exception handlers have an exceptional
syntax would set them apart from the rest of the code and make the
whole thing much easier to read and maintain.
it's hard to reason about it if your eyes just keep jumping into
the except bodies because they have the same indentation and
everything as the normal code. I am gonna say my proposal improves
accessibility, even if it doesn't make a difference to most ppl.
(also: I'm a they. forgot to include that in the reply. sorry.)
Python-ideas mailing list -- firstname.lastname@example.org
To unsubscribe send an email to email@example.com
Message archived at https://firstname.lastname@example.org/message/Z5QFJEQVW4TTB54X5MV3HUKE5TEBK63N/
Code of Conduct: http://python.org/psf/codeofconduct/