Re: Line continuation and comments

2023-02-27 Thread Robert Latest via Python-list
Robert Latest wrote: > Paul Bryan wrote: >> Adding to this, there should be no reason now in recent versions of >> Python to ever use line continuation. Black goes so far as to state >> "backslashes are bad and should never be used": >> >>

Re: Line continuation and comments

2023-02-27 Thread Robert Latest via Python-list
Paul Bryan wrote: > Adding to this, there should be no reason now in recent versions of > Python to ever use line continuation. Black goes so far as to state > "backslashes are bad and should never be used": > > https://black.readthedocs.io/en/stable/the_black_code_style/

Re: Line continuation and comments

2023-02-27 Thread Robert Latest via Python-list
Edmondo Giovannozzi wrote: > Il giorno mercoledì 22 febbraio 2023 alle 09:50:14 UTC+1 Robert Latest ha > scritto: >> I found myself building a complicated logical condition with many ands and >> ors which I made more manageable by putting the various terms on individual >> lines and breaking them

Re: Line continuation and comments

2023-02-24 Thread dn via Python-list
On 25/02/2023 10.04, Mark Bourne wrote: Personally, I don't particularly like the way you have to put multiline strings on the far left (rather than aligned with the rest of the scope) to avoid getting spaces at the beginning of each line.  I find it makes it more difficult to see where the

Re: Line continuation and comments

2023-02-24 Thread Roel Schroeven
Mark Bourne schreef op 24/02/2023 om 22:04: Personally, I don't particularly like the way you have to put multiline strings on the far left (rather than aligned with the rest of the scope) to avoid getting spaces at the beginning of each line. I find it makes it more difficult to see where the

Re: Line continuation and comments

2023-02-24 Thread Mark Bourne
t; HelpText += " Shift + Left click: Cook spam\n" ... Or perhaps just dumping the multi-line text into a file beforehand and reading that into a string! def someFunc(): The backslash is not looking like such a bad idea! LOL! -Original Message- From: Python-list On Behalf

Re: Line continuation and comments

2023-02-23 Thread Cameron Simpson
On 24/02/2023 12.45, Weatherby,Gerard wrote: NB my PyCharm-settings grumble whenever I create an identifier which is only used once (and perhaps, soon after it was established). I understand the (space) optimisation, but prefer to trade that for 'readability'. It isn't "space". Got an example

RE: Line continuation and comments

2023-02-23 Thread avi.e.gross
ld react if you used: self.LEGAL_AGE_US = 21 -Original Message- From: Python-list On Behalf Of dn via Python-list Sent: Thursday, February 23, 2023 9:01 PM To: python-list@python.org Subject: Re: Line continuation and comments On 24/02/2023 12.45, Weatherby,Gerard wrote: > “ > NB my PyCharm-s

Re: Line continuation and comments

2023-02-23 Thread dn via Python-list
On 24/02/2023 12.45, Weatherby,Gerard wrote: “ NB my PyCharm-settings grumble whenever I create an identifier which is only used once (and perhaps, soon after it was established). I understand the (space) optimisation, but prefer to trade that for 'readability'. “ I haven’t seen that one. What

Re: Line continuation and comments

2023-02-23 Thread Weatherby,Gerard
)->bool: LEGAL_AGE_US = 21 return LEGAL_AGE It doesn’t like LEGAL_AGE_US being all caps if declared in a function. From: Python-list on behalf of dn via Python-list Date: Thursday, February 23, 2023 at 5:46 PM To: python-list@python.org Subject: Re: Line continuation and comme

Re: Line continuation and comments

2023-02-23 Thread dn via Python-list
On 22/02/2023 21.49, Robert Latest via Python-list wrote: I found myself building a complicated logical condition with many ands and ors which I made more manageable by putting the various terms on individual lines and breaking them with the "\" line continuation character. In this context it

RE: Line continuation and comments

2023-02-23 Thread avi.e.gross
ps just dumping the multi-line text into a file beforehand and reading that into a string! def someFunc(): The backslash is not looking like such a bad idea! LOL! -Original Message- From: Python-list On Behalf Of Rob Cliffe via Python-list Sent: Wednesday, February 22, 2023 2:08 PM To:

Re: Line continuation and comments

2023-02-23 Thread Rob Cliffe via Python-list
On 22/02/2023 15:23, Paul Bryan wrote: Adding to this, there should be no reason now in recent versions of Python to ever use line continuation. Black goes so far as to state "backslashes are bad and should never be used":

Re: Line continuation and comments

2023-02-22 Thread Cameron Simpson
On 22Feb2023 11:27, Thomas Passin wrote: On 2/22/2023 10:02 AM, Weatherby,Gerard wrote: That’s a neat tip. End of line comments work, too x = (3 > 4 #never and 7 == 7 # hopefully or datetime.datetime.now().day > 15 # sometimes ) print(x) I find myself doing this more and

Re: Line continuation and comments

2023-02-22 Thread Thomas Passin
40 AM To: python-list@python.org Subject: Re: Line continuation and comments *** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. *** Il giorno mercoledì 22 febbraio 2023 alle 09:50:14 UTC+1 Robert Latest ha scritto: I found myself buildi

Re: Line continuation and comments

2023-02-22 Thread Weatherby,Gerard
on.org Subject: Re: Line continuation and comments *** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. *** Il giorno mercoledì 22 febbraio 2023 alle 09:50:14 UTC+1 Robert Latest ha scritto: > I found myself building a complicated logical

Re: Line continuation and comments

2023-02-22 Thread Paul Bryan
Adding to this, there should be no reason now in recent versions of Python to ever use line continuation. Black goes so far as to state "backslashes are bad and should never be used":

Re: Line continuation and comments

2023-02-22 Thread Edmondo Giovannozzi
Il giorno mercoledì 22 febbraio 2023 alle 09:50:14 UTC+1 Robert Latest ha scritto: > I found myself building a complicated logical condition with many ands and > ors > which I made more manageable by putting the various terms on individual lines > and breaking them with the "\" line