On 2/21/19 7:06 PM, Chris Barker via Python-ideas wrote:
> On Thu, Feb 21, 2019 at 12:01 PM Raymond Hettinger
> <raymond.hettin...@gmail.com> wrote:

>> class Frabawidget:
>>     ...
>>     @wozzle.setter
>>     def (self, woozle):
>>         if not (self.min_woozle < woozle < self.max_woozle):
>>             raise ValueError(f"Expected woozle to be between
>> {self.min_woozle} and {self.max_woozle}")
>>         self._wozzle = normalize(woozle)
>>

> That's 103 chars long -- and very readable. But, is this that much
> worse?

> class Frabawidget:
>      ...
>      @wozzle.setter
>      def (self, woozle):
>          if not (self.min_woozle < woozle < self.max_woozle):
>              raise ValueError(f"Expected woozle to be between"
>                                "{self.min_woozle} and {self.max_woozle}")
>          self._wozzle = normalize(woozle)

I remain against longer lines.  I break 80 characters extremely rarely,
if ever, and at times start breaking long lines before that.  I find
Chris's code more readable.

I'm even more against for backwards incompatibility and hard-to-read
exception messages.  ;-)

Chris's code doesn't quite match Raymond's; Chris lost a space between
(ironically) "between" and "{self.min_woozle}."

Dan
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to