Re: [Python-ideas] PEP 8 update on line length

2019-02-22 Thread Juancarlo Añez
On Fri, Feb 22, 2019 at 5:10 PM Greg Ewing wrote: > I would say it the other way around. Once you've reduced the complexity > of a line to something a human can handle, *most* of the time 80 chars > is enough. > +1 It has been known for a very long time. These are *old *books that talk about

Re: [Python-ideas] Type hints for functions with side-effects and for functions raising exceptions

2019-02-22 Thread Chris Angelico
On Sat, Feb 23, 2019 at 9:14 AM Kyle Lahnakoski wrote: > Let me call this pattern the Catch-It-Name-It-Chain-It-Raise-It (CNCR) > pattern > > There are a few reasons for this. > > 1. I can add runtime values to the exception so I get a better sense of > the program state without going to the

Re: [Python-ideas] Type hints for functions with side-effects and for functions raising exceptions

2019-02-22 Thread Kyle Lahnakoski
On 2019-02-21 03:09, Christopher Barker wrote: > > But yes, there is no (easy) way to distinguish an Exception raised by the function you called, and one raised somewhere deeper that. > > And I have been bitten by that more than once. It makes "Easier to ask forgiveness than permission" kind of

Re: [Python-ideas] PEP 8 update on line length

2019-02-22 Thread Greg Ewing
Christopher Barker wrote: (And did they ever stop to wonder why those old terminals standardized on 80 columns?) Probably because IBM decided on 80 columns for their punched cards. And that probably didn't have anything to do with a readable width for text. Nobody used computers for

Re: [Python-ideas] Type hints for functions with side-effects and for functions raising exceptions

2019-02-22 Thread Juancarlo Añez
On Thu, Feb 21, 2019 at 11:32 PM Chris Angelico wrote: > On Fri, Feb 22, 2019 at 2:27 PM Juancarlo Añez wrote: > > Then, if exceptions are going to be part of a type, there should be a > way to express the semantics of them (like in Eiffel), so > stack.pop();stack.push(x) doesn't have to catch

Re: [Python-ideas] Type hints for functions with side-effects and for functions raising exceptions

2019-02-22 Thread Chris Angelico
On Sat, Feb 23, 2019 at 5:32 AM Juancarlo Añez wrote: > On Thu, Feb 21, 2019 at 11:32 PM Chris Angelico wrote: >> >> On Fri, Feb 22, 2019 at 2:27 PM Juancarlo Añez wrote: >> > Then, if exceptions are going to be part of a type, there should be a way >> > to express the semantics of them (like

Re: [Python-ideas] PEP 8 update on line length

2019-02-22 Thread Jonathan Fine
Raymond Hettinger posted a helpful example to this list. Here, I run his example, and a variant, through https://black.now.sh Raymond class Frabawidget: @wozzle.setter def wibble(self, woozle): if not (self.min_woozle < woozle < self.max_woozle): raise

Re: [Python-ideas] PEP 8 update on line length

2019-02-22 Thread Dan Sommers
On 2/21/19 10:33 PM, Steven D'Aprano wrote: (And did they ever stop to wonder why those old terminals standardized on 80 columns?) Punch cards? https://softwareengineering.stackexchange.com/questions/148677 There's an ensuing discussion regarding the history of the size/shape of the punch

Re: [Python-ideas] PEP 8 update on line length

2019-02-22 Thread Christopher Barker
> > > Chris, the convention to limit text to somewhere around 60-80 characters > predates old terminals by *literally centuries*. Not for code, it doesn’t— and centuries ago, there were other technical issues on play for papermaking, hand writing, and typesetting. > (And did they ever stop to

Re: [Python-ideas] PEP 8 update on line length

2019-02-22 Thread James Lu
A general rule of thumb is, if Python feels inconvenient or awkward, you’re doing something wrong. ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: