Steven D'Aprano writes:
> On Tue, 5 Jul 2016 07:51 pm, Jussi Piitulainen wrote:
>
>> Chris Angelico writes:
>>
>>> On Tue, Jul 5, 2016 at 6:36 PM, Peter Otten wrote:
It looks like
$ python3 -c 'print({1, 2})'
{1, 2}
$ python3 -c 'print({2, 1})'
{1, 2}
will
On Tuesday, July 5, 2016 at 9:51:21 PM UTC+12, Jussi Piitulainen wrote:
>
> Chris Angelico writes:
>
>> Then hash randomization kicks in, and you can run the exact same line
>> of code multiple times and get different results. It's a coin toss.
>
> Oh, nice, a new way to generate random bits in s
On 07/05/2016 05:50 AM, Chris Angelico wrote:
> On Tue, Jul 5, 2016 at 9:33 PM, Peter Otten <__pete...@web.de> wrote:
>> Chris Angelico wrote:
>>
>>> On Tue, Jul 5, 2016 at 6:36 PM, Peter Otten <__pete...@web.de> wrote:
What will
$ cat foo.py
import foo
class A: pass
p
On Tue, Jul 5, 2016 at 9:33 PM, Peter Otten <__pete...@web.de> wrote:
> Chris Angelico wrote:
>
>> On Tue, Jul 5, 2016 at 6:36 PM, Peter Otten <__pete...@web.de> wrote:
>>> What will
>>>
>>> $ cat foo.py
>>> import foo
>>> class A: pass
>>> print(isinstance(foo.A(), A))
>>> $ python -c 'import foo'
Chris Angelico wrote:
> On Tue, Jul 5, 2016 at 6:36 PM, Peter Otten <__pete...@web.de> wrote:
>> What will
>>
>> $ cat foo.py
>> import foo
>> class A: pass
>> print(isinstance(foo.A(), A))
>> $ python -c 'import foo'
>> ...
>> $ python foo.py
>> ...
>>
>> print?
>
> I refuse to play around with
On Tue, 5 Jul 2016 07:51 pm, Jussi Piitulainen wrote:
> Chris Angelico writes:
>
>> On Tue, Jul 5, 2016 at 6:36 PM, Peter Otten wrote:
>>> It looks like
>>>
>>> $ python3 -c 'print({1, 2})'
>>> {1, 2}
>>> $ python3 -c 'print({2, 1})'
>>> {1, 2}
>>>
>>> will always print the same output. Can you c
On Tue, 5 Jul 2016 06:36 pm, Peter Otten wrote:
> It looks like
>
> $ python3 -c 'print({1, 2})'
> {1, 2}
> $ python3 -c 'print({2, 1})'
> {1, 2}
>
> will always print the same output. Can you construct a set from two small
> integers where this is not the case? What's the difference?
Define "s
Chris Angelico writes:
> On Tue, Jul 5, 2016 at 6:36 PM, Peter Otten wrote:
>> It looks like
>>
>> $ python3 -c 'print({1, 2})'
>> {1, 2}
>> $ python3 -c 'print({2, 1})'
>> {1, 2}
>>
>> will always print the same output. Can you construct a set from two small
>> integers where this is not the case
On Tue, Jul 5, 2016 at 4:33 PM, Steven D'Aprano
wrote:
> > Got any other tricky questions to add?
S
P
O
I
L
E
R
S
P
A
C
E
A
N
D
A
B
I
T
M
O
R
E
[Thanks Steven, I just copied and pasted your space. See? You can copy
and paste blank space and use it over and over. Could be a useful tip
for t
On Tue, Jul 5, 2016 at 6:36 PM, Peter Otten <__pete...@web.de> wrote:
> What will
>
> $ cat foo.py
> import foo
> class A: pass
> print(isinstance(foo.A(), A))
> $ python -c 'import foo'
> ...
> $ python foo.py
> ...
>
> print?
I refuse to play around with isinstance and old-style classes.
Particu
Am 05.07.16 um 10:22 schrieb Steven D'Aprano:
On Tuesday 05 July 2016 16:38, Chris Angelico wrote:
On Tue, Jul 5, 2016 at 4:33 PM, Steven D'Aprano
wrote:
What happens in this code snippet?
L = [1]
t = (L,)
t[0] += 1
Explain what value t has, and why.
Not sure you have that que
Chris Angelico wrote:
> After some discussion with a Ruby on Rails programmer about where Ruby
> ends and where Rails begins (and it's definitely not where I'd have
> expected... Rails does a ton of monkey-patching, including of built-in
> types, to provide functionality that is strangely absent f
On Tuesday 05 July 2016 16:38, Chris Angelico wrote:
> On Tue, Jul 5, 2016 at 4:33 PM, Steven D'Aprano
> wrote:
>> What happens in this code snippet?
>>
>> L = [1]
>> t = (L,)
>> t[0] += 1
>>
>> Explain what value t has, and why.
>
> Not sure you have that question right, because it
On Tue, Jul 5, 2016 at 4:33 PM, Steven D'Aprano
wrote:
> What happens in this code snippet?
>
> L = [1]
> t = (L,)
> t[0] += 1
>
> Explain what value t has, and why.
Not sure you have that question right, because it simply gives a
TypeError. You can't add an integer to a list.
ChrisA
On Tuesday 05 July 2016 14:02, Chris Angelico wrote:
> After some discussion with a Ruby on Rails programmer about where Ruby
> ends and where Rails begins (and it's definitely not where I'd have
> expected... Rails does a ton of monkey-patching, including of built-in
> types, to provide functiona
On Tuesday 05 July 2016 14:02, Chris Angelico wrote:
> After some discussion with a Ruby on Rails programmer about where Ruby
> ends and where Rails begins (and it's definitely not where I'd have
> expected... Rails does a ton of monkey-patching, including of built-in
> types, to provide functiona
After some discussion with a Ruby on Rails programmer about where Ruby
ends and where Rails begins (and it's definitely not where I'd have
expected... Rails does a ton of monkey-patching, including of built-in
types, to provide functionality that is strangely absent from the core
language), I tried
17 matches
Mail list logo