On 04/03/2018 09:48 AM, kar...@gmail.com wrote:
Semicolon is optional.
If you put a semicolon at the end of the of a statement, you can keep writing
statements.
a=3;b=2
PyCharm still complains about two statements on one line
and sites Pep 8. I never used to pay much attention to Pep 8,
but
Semicolon is optional.
If you put a semicolon at the end of the of a statement, you can keep writing
statements.
a=3;b=2
--
https://mail.python.org/mailman/listinfo/python-list
On 04/01/2018 11:31 PM, dlt.joaq...@gmail.com wrote:
El miércoles, 28 de agosto de 2013, 21:18:26 (UTC-3), Mohsen
Pahlevanzadeh escribió:
Dear all,
I'm C++ programmer and unfortunately put semicolon at end of my
statements in python.
Quesion: What's really defferences between putting semico
El miércoles, 28 de agosto de 2013, 21:18:26 (UTC-3), Mohsen Pahlevanzadeh
escribió:
> Dear all,
>
> I'm C++ programmer and unfortunately put semicolon at end of my
> statements in python.
>
> Quesion:
> What's really defferences between putting semicolon and don't put?
>
> Yours,
> Mohsen
We
Chris Angelico wrote:
> On Fri, Sep 6, 2013 at 12:05 AM, Jeremy Sanders
> wrote:
>> Chris Angelico wrote:
>>
>>> Because s/he thought it made for better code, or as a joke? Usually I
>>> see this sort of thing as the latter...
It was intended for clearer code, which is true if you don't like cur
On Fri, Sep 6, 2013 at 12:05 AM, Jeremy Sanders
wrote:
> Chris Angelico wrote:
>
>> Because s/he thought it made for better code, or as a joke? Usually I
>> see this sort of thing as the latter...
>
> http://oldhome.schmorp.de/marc/bournegol.html
> http://utcc.utoronto.ca/~cks/space/blog/programmi
On 2013-09-05, Duncan Booth wrote:
> Someone I knew actually used these definitions when writing C in a
> Pascalish, Algol68ish style (if I remembered them correctly):
>
> #define IF if(((
> #define AND ))&&((
> #define OR )||(
> #define THEN ))){
> #define ELSE }else{
> #define FI }
Yep, I once
Chris Angelico wrote:
> Because s/he thought it made for better code, or as a joke? Usually I
> see this sort of thing as the latter...
http://oldhome.schmorp.de/marc/bournegol.html
http://utcc.utoronto.ca/~cks/space/blog/programming/BourneGol
Jeremy
--
https://mail.python.org/mailman/listinf
On Thu, Sep 5, 2013 at 9:33 PM, Duncan Booth
wrote:
> Someone I knew actually used these definitions when writing C in a Pascalish,
> Algol68ish
> style (if I remembered them correctly):
>
> #define IF if(((
> #define AND ))&&((
> #define OR )||(
> #define THEN ))){
> #define ELSE }else{
> #defin
Chris Angelico wrote:
> On Thu, Aug 29, 2013 at 10:18 AM, Mohsen Pahlevanzadeh
> wrote:
>> Dear all,
>>
>> I'm C++ programmer and unfortunately put semicolon at end of my
>> statements in python.
>>
>> Quesion:
>> What's really defferences between putting semicolon and don't put?
>
> Very little
On 2013-09-03, Neil Cerutti wrote:
> 3.2 and above provide contextlib.ExitStack, which I just now
> learned about.
>
> with contextlib.ExitStack() as stack:
> _in = stack.enter_context(open('some_file'))
> _out = stack.enter_context(open('another_file', 'w'))
>
> It ain't beautiful, but it
On 2013-09-02, Roy Smith wrote:
> In article ,
> "albert visser" wrote:
>
>> I like being able to do e.g.
>>
>> with open('some_file') as _in, open('another_file', 'w') as _out:
>
> It would be nice if you could write that as:
>
> with open('some_file'), open('another_file, 'w') as _
Op 03-09-13 01:17, Modulok schreef:
>
> So? Indeed there are too many people looking at these things as fighting
> for the one true way. That is IMO part a big part of the problem. I have
> no problem if someone else uses a different style than I do. Python as
> a language tries t
> But, more than that, it saves the zillions of hours of
> time wasted arguing about which way is better.
>
XD Nice. That's about the best supporting argument I've heard.
-Modulok-
--
http://mail.python.org/mailman/listinfo/python-list
In article ,
Modulok wrote:
> > So? Indeed there are too many people looking at these things as fighting
> > for the one true way. That is IMO part a big part of the problem. I have
> > no problem if someone else uses a different style than I do. Python as
> > a language tries too hard to enforc
> So? Indeed there are too many people looking at these things as fighting
> for the one true way. That is IMO part a big part of the problem. I have
> no problem if someone else uses a different style than I do. Python as
> a language tries too hard to enforce a one true way.
>
>
Try maintaining
On Tue, Sep 3, 2013 at 3:58 AM, Tim Chase wrote:
> On 2013-09-02 10:47, Roy Smith wrote:
>> > > Perhaps he's worried about the world running out of tabs?
>> > >
>> > > I heard that most of the tab mines are in China and they're
>> > > going to stop exporting...
>> >
>> > And buying all that indent
On 2013-09-02 10:47, Roy Smith wrote:
> > > Perhaps he's worried about the world running out of tabs?
> > >
> > > I heard that most of the tab mines are in China and they're
> > > going to stop exporting...
> >
> > And buying all that indentation supports terrorists. Conserve
> > whitespace or t
In article ,
"albert visser" wrote:
> I like being able to do e.g.
>
> with open('some_file') as _in, open('another_file', 'w') as _out:
It would be nice if you could write that as:
with open('some_file'), open('another_file, 'w') as _in, _out:
--
http://mail.python.org/mailman/li
On Mon, 02 Sep 2013 12:58:23 +0200, Antoon Pardon
wrote:
Op 02-09-13 12:42, Fábio Santos schreef:
On 09/02/2013 10:45 AM, Antoon Pardon wrote:
Op 02-09-13 10:05, Steven D'Aprano schreef:
[...]
for item in seq: if cond:
do_this()
do_that()
else:
do_something else()
which
On Mon, 02 Sep 2013 20:14:40 +1000, Chris Angelico wrote:
> On Mon, Sep 2, 2013 at 7:52 PM, Steven D'Aprano
> wrote:
>> Instead, we would have spent 100 times as much time and energy debating
>> the One True Indentation Scheme, akin to the brace wars that went on
>> for *years* in the C community
In article ,
Tim Chase wrote:
> On 2013-09-02 14:20, Grant Edwards wrote:
> > >> This saves an indent level.
> > >
> > > Just out of interest: is saving an indent level a useful thing?
> >
> > Perhaps he's worried about the world running out of tabs?
> >
> > I heard that most of the tab mines
On 2013-09-02 14:20, Grant Edwards wrote:
> >> This saves an indent level.
> >
> > Just out of interest: is saving an indent level a useful thing?
>
> Perhaps he's worried about the world running out of tabs?
>
> I heard that most of the tab mines are in China and they're going to
> stop exportin
On 2013-08-31, Paul Rudin wrote:
> Jussi Piitulainen writes:
>
>
>> # Option 1.5
>> for spam in sequence:
>> if not predicate(spam): continue
>> process(spam)
>>
>> This saves an indent level.
>
> Just out of interest: is saving an indent level a useful thing?
Perhaps he's worried about
Op 02-09-13 12:42, Fábio Santos schreef:
> On 09/02/2013 10:45 AM, Antoon Pardon wrote:
>> Op 02-09-13 10:05, Steven D'Aprano schreef:
>>> It doesn't keep a whole chain of
>>> if clauses together. It doesn't let you do anything that you haven't
>>> already done. It just saves an indent and a newlin
Op 02-09-13 11:52, Steven D'Aprano schreef:
> On Mon, 02 Sep 2013 10:29:05 +0200, Antoon Pardon wrote:
>
>> Why should we be more
>> concerned with cascading ifs than with cascading controls in general?
>
> What cascading controls?
>
> for element in seq:
> if filter:
>
>
>
> is n
On 09/02/2013 10:45 AM, Antoon Pardon wrote:
Op 02-09-13 10:05, Steven D'Aprano schreef:
It doesn't keep a whole chain of
if clauses together. It doesn't let you do anything that you haven't
already done. It just saves an indent and a newline. The cost, on the
other hand, includes the risk that
On Mon, Sep 2, 2013 at 7:52 PM, Steven D'Aprano wrote:
> Instead, we would have spent 100 times as much time and energy debating
> the One True Indentation Scheme, akin to the brace wars that went on for
> *years* in the C community. And still haven't completely gone.
You mean like debating tabs
On Mon, 02 Sep 2013 10:29:05 +0200, Antoon Pardon wrote:
> Why should we be more
> concerned with cascading ifs than with cascading controls in general?
What cascading controls?
for element in seq:
if filter:
is not a cascading control.
[...]
> All these discussions
> about comb
Op 02-09-13 10:05, Steven D'Aprano schreef:
> On Sun, 01 Sep 2013 21:58:15 +0200, Antoon Pardon wrote:
>
>> Op 31-08-13 02:09, Steven D'Aprano schreef:
>
>>> Adding a fourth option:
>>>
>>> for spam in sequence if predicate(spam):
>>> process(spam)
>>>
>>> saves absolutely nothing except a l
Op 02-09-13 01:30, MRAB schreef:
> On 01/09/2013 20:58, Antoon Pardon wrote:
>> Op 31-08-13 02:09, Steven D'Aprano schreef:
>>> On Fri, 30 Aug 2013 11:32:17 +0100, Fábio Santos wrote:
>>>
>>
>>>
>>> We really are spoiled for choice here. We can write any of these:
>>>
>>> # Option 1
>>> for spam in
On Sun, 01 Sep 2013 21:58:15 +0200, Antoon Pardon wrote:
> Op 31-08-13 02:09, Steven D'Aprano schreef:
>> Adding a fourth option:
>>
>> for spam in sequence if predicate(spam):
>> process(spam)
>>
>> saves absolutely nothing except a line and an indent level, neither of
>> which are in short
On 01/09/2013 20:58, Antoon Pardon wrote:
Op 31-08-13 02:09, Steven D'Aprano schreef:
On Fri, 30 Aug 2013 11:32:17 +0100, Fábio Santos wrote:
We really are spoiled for choice here. We can write any of these:
# Option 1
for spam in sequence:
if predicate(spam):
process(spam)
Op 31-08-13 02:09, Steven D'Aprano schreef:
On Fri, 30 Aug 2013 11:32:17 +0100, Fábio Santos wrote:
We really are spoiled for choice here. We can write any of these:
# Option 1
for spam in sequence:
if predicate(spam):
process(spam)
Adding a fourth option:
for spam in se
Op 31-08-13 02:09, Steven D'Aprano schreef:
On Fri, 30 Aug 2013 11:32:17 +0100, Fábio Santos wrote:
On 29 Aug 2013 23:20, "Ben Finney" wrote:
Fábio Santos writes:
It is a shame that this is not possible in python. for..if exists in
comprehensions and not in regular loops but that would be
Paul Rudin writes:
> Jussi Piitulainen writes:
>
> > # Option 1.5
> > for spam in sequence:
> > if not predicate(spam): continue
> > process(spam)
> >
> > This saves an indent level.
>
> Just out of interest: is saving an indent level a useful thing?
It might be if process(spam) is a mor
Jussi Piitulainen writes:
> # Option 1.5
> for spam in sequence:
> if not predicate(spam): continue
> process(spam)
>
> This saves an indent level.
Just out of interest: is saving an indent level a useful thing?
I wouldn't lay out my code like that just because if you're coming back
to
Steven D'Aprano writes:
> We really are spoiled for choice here. We can write any of these:
>
> # Option 1
> for spam in sequence:
> if predicate(spam):
> process(spam)
# Option 1.5
for spam in sequence:
if not predicate(spam): continue
process(spam)
This saves an indent lev
On 8/30/2013 8:09 PM, Steven D'Aprano wrote:
We really are spoiled for choice here. We can write any of these:
# Option 1
for spam in sequence:
if predicate(spam):
process(spam)
# Option 2
for spam in filter(predicate, sequence):
process(spam)
# Option 3
for spam in (spam f
On Fri, 30 Aug 2013 11:32:17 +0100, Fábio Santos wrote:
> On 29 Aug 2013 23:20, "Ben Finney" wrote:
>>
>> Fábio Santos writes:
>>
>> > It is a shame that this is not possible in python. for..if exists in
>> > comprehensions and not in regular loops but that would be nice
>> > sometimes.
>>
>> So
On Sat, Aug 31, 2013 at 12:14 AM, Antoon Pardon
wrote:
> Maybe python should just allow more than one control structure on one
> line and then considers the end of the suite the end of both controls.
> In that case we could just write the following:
>
> for a in lst: if a % 2:
> treat a
>
Op 30-08-13 12:53, Roy Smith schreef:
> In article ,
> Fábio Santos wrote:
>
>> On 29 Aug 2013 23:20, "Ben Finney" wrote:
>>>
>>> Fábio Santos writes:
>>>
It is a shame that this is not possible in python. for..if exists in
comprehensions and not in regular loops but that would be ni
In article ,
Fábio Santos wrote:
> On 29 Aug 2013 23:20, "Ben Finney" wrote:
> >
> > Fábio Santos writes:
> >
> > > It is a shame that this is not possible in python. for..if exists in
> > > comprehensions and not in regular loops but that would be nice
> > > sometimes.
> >
> > So you use it i
On 29 Aug 2013 23:20, "Ben Finney" wrote:
>
> Fábio Santos writes:
>
> > It is a shame that this is not possible in python. for..if exists in
> > comprehensions and not in regular loops but that would be nice
> > sometimes.
>
> So you use it in a generator expression, and iterate over the generat
Op 30-08-13 09:25, Chris Angelico schreef:
> On Fri, Aug 30, 2013 at 5:15 PM, Antoon Pardon
> wrote:
>> Op 30-08-13 06:55, Ben Finney schreef:
>>> Ben Finney writes:
>>>
Fábio Santos writes:
> It is a shame that this is not possible in python. for..if exists in
> comprehensions
On Fri, Aug 30, 2013 at 5:15 PM, Antoon Pardon
wrote:
> Op 30-08-13 06:55, Ben Finney schreef:
>> Ben Finney writes:
>>
>>> Fábio Santos writes:
>>>
It is a shame that this is not possible in python. for..if exists in
comprehensions and not in regular loops but that would be nice
Op 30-08-13 06:55, Ben Finney schreef:
> Ben Finney writes:
>
>> Fábio Santos writes:
>>
>>> It is a shame that this is not possible in python. for..if exists in
>>> comprehensions and not in regular loops but that would be nice
>>> sometimes.
>> for foo in (spam for spam in sequence if pred
Ben Finney writes:
> Fábio Santos writes:
>
> > It is a shame that this is not possible in python. for..if exists in
> > comprehensions and not in regular loops but that would be nice
> > sometimes.
> for foo in (spam for spam in sequence if predicate(spam)): …
Better:
for foo in filte
On Fri, Aug 30, 2013 at 8:17 AM, Ben Finney wrote:
> Fábio Santos writes:
>
>> It is a shame that this is not possible in python. for..if exists in
>> comprehensions and not in regular loops but that would be nice
>> sometimes.
>
> So you use it in a generator expression, and iterate over the gen
Fábio Santos writes:
> It is a shame that this is not possible in python. for..if exists in
> comprehensions and not in regular loops but that would be nice
> sometimes.
So you use it in a generator expression, and iterate over the generator:
for foo in (spam for spam in sequence if predica
Op 29-08-13 09:50, Gary Herron schreef:
> On 08/28/2013 07:10 PM, Sam Fourman Jr. wrote:
>>
>> On Wed, Aug 28, 2013 at 8:18 PM, Mohsen Pahlevanzadeh
>> mailto:moh...@pahlevanzadeh.org>> wrote:
>>
>> Dear all,
>>
>> I'm C++ programmer and unfortunately put semicolon at end of my
>> state
On 29 Aug 2013 10:54, "Chris Angelico" wrote:
>
> foreach (some_array, mixed val) if (some_condition)
> {
> //do something with val
> }
>
I hope that you don't mind that I have started to use this in JavaScript
back at work. Its foreach loop requires you to do a filter all the time.
It is a
On Thu, Aug 29, 2013 at 7:39 PM, Alister wrote:
> Yet no doubt you voluntarily indent your c code to make it readable?
> it wont take long before you find you don't even think about indentation
> and actually like it
Most of the time, in any language, I will indeed have indentation
matching the s
On Wed, 28 Aug 2013 22:10:16 -0400, Sam Fourman Jr. wrote:
> On Wed, Aug 28, 2013 at 8:18 PM, Mohsen Pahlevanzadeh <
> moh...@pahlevanzadeh.org> wrote:
>
>> Dear all,
>>
>> I'm C++ programmer and unfortunately put semicolon at end of my
>> statements in python.
>>
>> Quesion:
>> What's really def
On 08/28/2013 07:10 PM, Sam Fourman Jr. wrote:
On Wed, Aug 28, 2013 at 8:18 PM, Mohsen Pahlevanzadeh
mailto:moh...@pahlevanzadeh.org>> wrote:
Dear all,
I'm C++ programmer and unfortunately put semicolon at end of my
statements in python.
Quesion:
What's really defference
On Wed, Aug 28, 2013 at 8:18 PM, Mohsen Pahlevanzadeh <
moh...@pahlevanzadeh.org> wrote:
> Dear all,
>
> I'm C++ programmer and unfortunately put semicolon at end of my
> statements in python.
>
> Quesion:
> What's really defferences between putting semicolon and don't put?
>
> Yours,
> Mohsen
I
On Thu, 29 Aug 2013 04:48:26 +0430, Mohsen Pahlevanzadeh wrote:
> Dear all,
>
> I'm C++ programmer and unfortunately put semicolon at end of my
> statements in python.
>
> Quesion:
> What's really defferences between putting semicolon and don't put?
It's about the same as writing this:
x = 1
In article ,
Chris Angelico wrote:
> This is about Perl, but may be of interest.
>
> http://www.perl.com/pub/2007/12/06/soto-11.html
I got about halfway through, then raised an uncaught TLDNR Exception.
But I did like what he had to say about Tcl.
Tcl is under-appreciated. A few gigs back,
On Thu, Aug 29, 2013 at 10:33 AM, Roy Smith wrote:
> In article ,
> Mohsen Pahlevanzadeh wrote:
>
>> Dear all,
>>
>> I'm C++ programmer and unfortunately put semicolon at end of my
>> statements in python.
>>
>> Quesion:
>> What's really defferences between putting semicolon and don't put?
>
> I
On Thu, Aug 29, 2013 at 10:37 AM, Tim Chase
wrote:
> On 2013-08-29 10:31, Chris Angelico wrote:
>> but putting semicolons at the ends of Python statements is as
>> useless as putting lots of (((irritating (((superfluous
>> (((parentheses) in your C++ code. The parser won't mind,
>>
On 8/28/13 8:18 PM, Mohsen Pahlevanzadeh wrote:
Dear all,
I'm C++ programmer and unfortunately put semicolon at end of my
statements in python.
Quesion:
What's really defferences between putting semicolon and don't put?
There is no difference. The semicolon is unnecessary in Python. If you
i
In article ,
Mohsen Pahlevanzadeh wrote:
> Dear all,
>
> I'm C++ programmer and unfortunately put semicolon at end of my
> statements in python.
>
> Quesion:
> What's really defferences between putting semicolon and don't put?
In theory, nothing. In practice, all the real Python programmers
On 2013-08-29 10:31, Chris Angelico wrote:
> but putting semicolons at the ends of Python statements is as
> useless as putting lots of (((irritating (((superfluous
> (((parentheses) in your C++ code. The parser won't mind,
> but subsequent programmers will wonder what these unneces
On 2013-08-29 04:48, Mohsen Pahlevanzadeh wrote:
> I'm C++ programmer and unfortunately put semicolon at end of my
> statements in python.
>
> Quesion:
> What's really defferences between putting semicolon and don't put?
>From a technical standpoint, nothing (see below). From a "readability
on t
On Thu, Aug 29, 2013 at 10:18 AM, Mohsen Pahlevanzadeh
wrote:
> Dear all,
>
> I'm C++ programmer and unfortunately put semicolon at end of my
> statements in python.
>
> Quesion:
> What's really defferences between putting semicolon and don't put?
Very little. Putting the semicolon makes you look
65 matches
Mail list logo