From: Tim Chase
On 2018-06-23 23:08, Jim Lee wrote:
>>> On 06/23/2018 10:03 PM, Steven D'Aprano wrote:
def test():
a = 1
b = 2
result = [value for key, value in locals().items()]
return result
what would you expect the result of calling t
From: Tim Chase
On 2018-06-24 05:03, Steven D'Aprano wrote:
> I'd like to run a quick survey. There is no right or wrong answer,
> since this is about your EXPECTATIONS, not what Python actually
> does.
>
> Given this function:
>
> def test():
> a = 1
> b = 2
> result = [value for key
From: Ben Finney
Paul Moore writes:
> On 24 June 2018 at 06:03, Steven D'Aprano
> wrote:
> > Given this function:
> >
> > def test():
> > a = 1
> > b = 2
> > result = [value for key, value in locals().items()]
> > return result
> >
> > what would you expect the result of callin
From: Paul Moore
On 24 June 2018 at 06:03, Steven D'Aprano
wrote:
> I'd like to run a quick survey. There is no right or wrong answer, since
> this is about your EXPECTATIONS, not what Python actually does.
>
> Given this function:
>
>
> def test():
> a = 1
> b = 2
> result = [value
On 26-06-18 12:39, Steven D'Aprano wrote:
> On Tue, 26 Jun 2018 12:04:16 +0200, Antoon Pardon wrote:
>
>> On 26-06-18 11:22, Steven D'Aprano wrote:
>>> On Tue, 26 Jun 2018 10:20:38 +0200, Antoon Pardon wrote:
>>>
> def test():
> a = 1
> b = 2
> result = [value for key, v
On Tue, 26 Jun 2018 12:04:16 +0200, Antoon Pardon wrote:
> On 26-06-18 11:22, Steven D'Aprano wrote:
>> On Tue, 26 Jun 2018 10:20:38 +0200, Antoon Pardon wrote:
>>
def test():
a = 1
b = 2
result = [value for key, value in locals().items()] return result
>> [...]
>>
On 26 June 2018 at 11:09, Chris Angelico wrote:
> On Tue, Jun 26, 2018 at 8:04 PM, Antoon Pardon wrote:
>> On 26-06-18 11:22, Steven D'Aprano wrote:
>>> On Tue, 26 Jun 2018 10:20:38 +0200, Antoon Pardon wrote:
>>>
> def test():
> a = 1
> b = 2
> result = [value for key
On 26-06-18 12:09, Chris Angelico wrote:
> On Tue, Jun 26, 2018 at 8:04 PM, Antoon Pardon wrote:
>> On 26-06-18 11:22, Steven D'Aprano wrote:
>>> On Tue, 26 Jun 2018 10:20:38 +0200, Antoon Pardon wrote:
>>>
> def test():
> a = 1
> b = 2
> result = [value for key, value
On Tue, Jun 26, 2018 at 8:04 PM, Antoon Pardon wrote:
> On 26-06-18 11:22, Steven D'Aprano wrote:
>> On Tue, 26 Jun 2018 10:20:38 +0200, Antoon Pardon wrote:
>>
def test():
a = 1
b = 2
result = [value for key, value in locals().items()]
return result
>> [..
On 26-06-18 11:22, Steven D'Aprano wrote:
> On Tue, 26 Jun 2018 10:20:38 +0200, Antoon Pardon wrote:
>
>>> def test():
>>> a = 1
>>> b = 2
>>> result = [value for key, value in locals().items()]
>>> return result
> [...]
>
>> I would expect an UnboundLocalError: local variable 'resu
On Tue, 26 Jun 2018 10:20:38 +0200, Antoon Pardon wrote:
>> def test():
>> a = 1
>> b = 2
>> result = [value for key, value in locals().items()]
>> return result
[...]
> I would expect an UnboundLocalError: local variable 'result' referenced
> before assignment.
Well, I did say t
On 24-06-18 07:03, Steven D'Aprano wrote:
> I'd like to run a quick survey. There is no right or wrong answer, since
> this is about your EXPECTATIONS, not what Python actually does.
>
> Given this function:
>
>
> def test():
> a = 1
> b = 2
> result = [value for key, value in locals()
From: Jim Lee
On 06/23/2018 11:02 PM, Chris Angelico wrote:
> On Sun, Jun 24, 2018 at 3:44 PM, Jim Lee wrote:
>>
>> On 06/23/2018 10:03 PM, Steven D'Aprano wrote:
>>> I'd like to run a quick survey. There is no right or wrong answer, since
>>> this is about your EXPECTATIONS, not what Python a
From: Jim Lee
On 06/23/2018 10:03 PM, Steven D'Aprano wrote:
> I'd like to run a quick survey. There is no right or wrong answer, since
> this is about your EXPECTATIONS, not what Python actually does.
>
> Given this function:
>
>
> def test():
> a = 1
> b = 2
> result = [value f
From: Steven D'Aprano
On Sun, 24 Jun 2018 15:18:49 +1000, Chris Angelico wrote:
> Personally, I think it should give you [1, 2], the two values from the
> function's locals.
Thank you, that's the sort of answer I'm looking for.
(I'm not saying I didn't read your long and involved analysis, onl
From: Chris Angelico
On Sun, Jun 24, 2018 at 3:03 PM, Steven D'Aprano
wrote:
> I'd like to run a quick survey. There is no right or wrong answer, since
> this is about your EXPECTATIONS, not what Python actually does.
>
> Given this function:
>
>
> def test():
> a = 1
> b = 2
> resul
From: Jim Lee
On 06/23/2018 11:16 PM, Chris Angelico wrote:
> On Sun, Jun 24, 2018 at 4:08 PM, Jim Lee wrote:
>> There are three locals: a, b, and result. Since result cannot be assigned
>> a value until the list comp has been evaluated, I would expect the comp to
>> return a value of "None"
From: Chris Angelico
On Sun, Jun 24, 2018 at 4:08 PM, Jim Lee wrote:
> There are three locals: a, b, and result. Since result cannot be assigned
> a value until the list comp has been evaluated, I would expect the comp to
> return a value of "None" for result. An argument could also be made f
From: Chris Angelico
On Sun, Jun 24, 2018 at 3:44 PM, Jim Lee wrote:
>
>
> On 06/23/2018 10:03 PM, Steven D'Aprano wrote:
>>
>> I'd like to run a quick survey. There is no right or wrong answer, since
>> this is about your EXPECTATIONS, not what Python actually does.
>>
>> Given this function:
>
From: Steven D'Aprano
I'd like to run a quick survey. There is no right or wrong answer, since this
is about your EXPECTATIONS, not what Python actually does.
Given this function:
def test():
a = 1
b = 2
result = [value for key, value in locals().items()]
return result
what
On 2018-06-23 23:08, Jim Lee wrote:
>>> On 06/23/2018 10:03 PM, Steven D'Aprano wrote:
def test():
a = 1
b = 2
result = [value for key, value in locals().items()]
return result
what would you expect the result of calling test() to be?
>>>
On 2018-06-24 05:03, Steven D'Aprano wrote:
> I'd like to run a quick survey. There is no right or wrong answer,
> since this is about your EXPECTATIONS, not what Python actually
> does.
>
> Given this function:
>
> def test():
> a = 1
> b = 2
> result = [value for key, value in local
Paul Moore writes:
> On 24 June 2018 at 06:03, Steven D'Aprano
> wrote:
> > Given this function:
> >
> > def test():
> > a = 1
> > b = 2
> > result = [value for key, value in locals().items()]
> > return result
> >
> > what would you expect the result of calling test() to be? […]
On 24 June 2018 at 06:03, Steven D'Aprano
wrote:
> I'd like to run a quick survey. There is no right or wrong answer, since
> this is about your EXPECTATIONS, not what Python actually does.
>
> Given this function:
>
>
> def test():
> a = 1
> b = 2
> result = [value for key, value in l
On 06/23/2018 11:16 PM, Chris Angelico wrote:
On Sun, Jun 24, 2018 at 4:08 PM, Jim Lee wrote:
There are three locals: a, b, and result. Since result cannot be assigned
a value until the list comp has been evaluated, I would expect the comp to
return a value of "None" for result. An argumen
On Sun, Jun 24, 2018 at 4:08 PM, Jim Lee wrote:
> There are three locals: a, b, and result. Since result cannot be assigned
> a value until the list comp has been evaluated, I would expect the comp to
> return a value of "None" for result. An argument could also be made for [1,
> 2, []], but on
On 06/23/2018 11:02 PM, Chris Angelico wrote:
On Sun, Jun 24, 2018 at 3:44 PM, Jim Lee wrote:
On 06/23/2018 10:03 PM, Steven D'Aprano wrote:
I'd like to run a quick survey. There is no right or wrong answer, since
this is about your EXPECTATIONS, not what Python actually does.
Given this f
On Sun, Jun 24, 2018 at 3:44 PM, Jim Lee wrote:
>
>
> On 06/23/2018 10:03 PM, Steven D'Aprano wrote:
>>
>> I'd like to run a quick survey. There is no right or wrong answer, since
>> this is about your EXPECTATIONS, not what Python actually does.
>>
>> Given this function:
>>
>>
>> def test():
>>
On 06/23/2018 10:03 PM, Steven D'Aprano wrote:
I'd like to run a quick survey. There is no right or wrong answer, since
this is about your EXPECTATIONS, not what Python actually does.
Given this function:
def test():
a = 1
b = 2
result = [value for key, value in locals().item
On Sun, 24 Jun 2018 15:18:49 +1000, Chris Angelico wrote:
> Personally, I think it should give you [1, 2], the two values from the
> function's locals.
Thank you, that's the sort of answer I'm looking for.
(I'm not saying I didn't read your long and involved analysis, only that
I'm not looking
On Sun, Jun 24, 2018 at 3:03 PM, Steven D'Aprano
wrote:
> I'd like to run a quick survey. There is no right or wrong answer, since
> this is about your EXPECTATIONS, not what Python actually does.
>
> Given this function:
>
>
> def test():
> a = 1
> b = 2
> result = [value for key, val
I'd like to run a quick survey. There is no right or wrong answer, since
this is about your EXPECTATIONS, not what Python actually does.
Given this function:
def test():
a = 1
b = 2
result = [value for key, value in locals().items()]
return result
what would you expect the r
32 matches
Mail list logo