On 7/22/2016 8:27 PM, Marco S. via Python-list wrote:
I'm developing a web app based on aiohttp, and I find the event loop
concept very interesting. I never programmed with it before, but I
know that node.js and GUIs are based on it.
What I can't understand is how asyncio make it possible to run
Steven D'Aprano :
> On Sat, 23 Jul 2016 01:33 am, Kent Tong wrote:
>> I'm aware that we can use 'pass' as an empty code block. But why
>> doesn't python allow a code block to be empty and thus eliminate the
>> need for this null statement?
>
> Because it cannot tell the difference between an empty
On Sat, Jul 23, 2016 at 9:13 PM, Marko Rauhamaa wrote:
>> One less thing to be programmed, one less thing for the user to
>> remember. Just require pass any time you have an empty block, rather
>> than try to remember where it is required and were it is optional.
>
> Actually, the requirement of a
Chris Angelico :
> On Sat, Jul 23, 2016 at 9:13 PM, Marko Rauhamaa wrote:
>>> One less thing to be programmed, one less thing for the user to
>>> remember. Just require pass any time you have an empty block, rather
>>> than try to remember where it is required and were it is optional.
>>
>> Actua
On Sat, 23 Jul 2016 14:13:46 +0300
Marko Rauhamaa wrote:
> > for x in sequence:
> > print('loop')
> >
> > Is that meant to print 'loop' each time around the loop, or just
> > once, at the end of the loop?
>
> I don't see an ambiguity: obviously the print call takes place after
> finishing the loo
On Saturday, July 23, 2016 at 4:44:00 PM UTC+5:30, Marko Rauhamaa wrote:
> Steven D'Aprano :
>
> > On Sat, 23 Jul 2016 01:33 am, Kent Tong wrote:
> >> I'm aware that we can use 'pass' as an empty code block. But why
> >> doesn't python allow a code block to be empty and thus eliminate the
> >> nee
"D'Arcy J.M. Cain" :
> On Sat, 23 Jul 2016 14:13:46 +0300
> Marko Rauhamaa wrote:
>> I don't see an ambiguity: obviously the print call takes place after
>> finishing the loop.
>
> It's ambiguous to the reader what was actually meant. Forcing a "pass"
> there shows the reader that the empty bloc
On Sat, 23 Jul 2016 16:13:58 +0300
Marko Rauhamaa wrote:
> "D'Arcy J.M. Cain" :
> > It's ambiguous to the reader what was actually meant. Forcing a
> > "pass" there shows the reader that the empty block was not a
> > mistake.
>
> Just let the syntax speak for itself. The code means what the lang
On 23/07/2016 12:34, Chris Angelico wrote:
On Sat, Jul 23, 2016 at 9:13 PM, Marko Rauhamaa wrote:
One less thing to be programmed, one less thing for the user to
remember. Just require pass any time you have an empty block, rather
than try to remember where it is required and were it is optiona
On Fri, Jul 22, 2016 at 6:27 PM, Marco S. via Python-list
wrote:
> Furthermore I have a question about exceptions in asyncio. If I
> understand well how it works, tasks exceptions can be caught only if
> you wait for task completion, with yield from, await or
> loop.run_until_complete(future). But
On 23/07/2016 14:54, D'Arcy J.M. Cain wrote:
On Sat, 23 Jul 2016 16:13:58 +0300
Marko Rauhamaa wrote:
"D'Arcy J.M. Cain" :
It's ambiguous to the reader what was actually meant. Forcing a
"pass" there shows the reader that the empty block was not a
mistake.
Just let the syntax speak for itse
On Sun, Jul 24, 2016 at 12:00 AM, BartC wrote:
> On 23/07/2016 12:34, Chris Angelico wrote:
>>
>> On Sat, Jul 23, 2016 at 9:13 PM, Marko Rauhamaa wrote:
One less thing to be programmed, one less thing for the user to
remember. Just require pass any time you have an empty block, rat
On Sun, 24 Jul 2016 12:06 am, BartC wrote:
> pass can only do so much. If doesn't help here:
>
> for x in sequence:
> print("Something")
> print("Something else")
>
> Was the second print meant to be indented as well or not?
True. But once you start wondering about code the programmer
Hi,
I am basically trying to solve the following problem
http://stackoverflow.com/questions/38540424/open-power-shell-as-admin-on-remote-vm
Regards
Clove
--
https://mail.python.org/mailman/listinfo/python-list
Heuh case 2 :
"String1" or "String2"
Evaluates to "String1" ?
--
https://mail.python.org/mailman/listinfo/python-list
On 2016-07-23 19:18, gst wrote:
Heuh case 2 :
"String1" or "String2"
Evaluates to "String1" ?
Suppose you have:
x or y
If bool(x) returns True, then the result will be x, else the result will
be y.
Example 1:
bool("String1") returns True, therefore the result of:
"String1" or "
On Sun, 24 Jul 2016 04:18 am, gst wrote:
> Heuh case 2 :
>
> "String1" or "String2"
>
> Evaluates to "String1" ?
Correct. What did you expect?
Have you read the Fine Manual?
https://docs.python.org/3/reference/expressions.html#boolean-operations
--
Steven
“Cheer up,” they said, “things
17 matches
Mail list logo