Re: Pep8 for long pattern

2018-03-28 Thread Rhodri James
On 27/03/18 22:02, Dan Stromberg wrote: On Tue, Mar 27, 2018 at 8:18 AM, Michael Torrie wrote: But when it's exactly what you need, why do you need to shoehorn the expression into 79 characters? Seems pointless in a case like this. PEP8 is a guideline, not an absolute rule. It's okay to bend

Re: Pep8 for long pattern

2018-03-27 Thread Rick Johnson
On Tuesday, March 27, 2018 at 9:37:14 PM UTC-5, Dan Stromberg wrote: > I can easily get 132+ columns of a font large enough for my > 52 year old eyes on a 15" laptop. Well, if you're comfortable with the long lines, fine. But be aware that long lines are poo-pooed in most professional enviroments.

Re: Pep8 for long pattern

2018-03-27 Thread Dan Stromberg
On Tue, Mar 27, 2018 at 4:37 PM, Rick Johnson wrote: > On Tuesday, March 27, 2018 at 4:02:37 PM UTC-5, Dan Stromberg wrote: >> On Tue, Mar 27, 2018 at 8:18 AM, Michael Torrie wrote: >> > But when it's exactly what you need, why do you need to >> > shoehorn the expression into 79 characters? Seem

Re: Pep8 for long pattern

2018-03-27 Thread Rick Johnson
On Tuesday, March 27, 2018 at 4:02:37 PM UTC-5, Dan Stromberg wrote: > On Tue, Mar 27, 2018 at 8:18 AM, Michael Torrie wrote: > > But when it's exactly what you need, why do you need to > > shoehorn the expression into 79 characters? Seems > > pointless in a case like this. PEP8 is a guideline, n

Re: Pep8 for long pattern

2018-03-27 Thread Dan Stromberg
On Tue, Mar 27, 2018 at 8:18 AM, Michael Torrie wrote: > But when it's exactly what you need, why do > you need to shoehorn the expression into 79 characters? Seems pointless > in a case like this. PEP8 is a guideline, not an absolute rule. It's > okay to bend it a bit in cases like this. I thi

Re: Pep8 for long pattern

2018-03-27 Thread Michael Torrie
On 03/27/2018 08:17 AM, Ganesh Pal wrote: > Hello Python friends, > > How do I split the below regex , so that it fits within the character > limit of 79 words > > > pattern = [ > r'(?P([0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+::HEAD))', > > r'(?P(owner:\s+[0-9a-fA-F]+:

Re: Pep8 for long pattern

2018-03-27 Thread Serhiy Storchaka
27.03.18 17:17, Ganesh Pal пише: How do I split the below regex , so that it fits within the character limit of 79 words pattern = [ r'(?P([0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+::HEAD))', r'(?P(owner:\s+[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]

Re: Pep8 for long pattern

2018-03-27 Thread Paul Moore
Use re.X - see https://docs.python.org/3.6/library/re.html#re.X for details. On 27 March 2018 at 15:17, Ganesh Pal wrote: > Hello Python friends, > > How do I split the below regex , so that it fits within the character > limit of 79 words > > > pattern = [ > r'(?P([0-9a-fA-F]+:[0-9a-fA-F]+:[0-

Pep8 for long pattern

2018-03-27 Thread Ganesh Pal
Hello Python friends, How do I split the below regex , so that it fits within the character limit of 79 words pattern = [ r'(?P([0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+::HEAD))', r'(?P(owner:\s+[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+:[0-9a-fA-F]+::HEAD))',