Re: dictionary initialization
Peter Hansen wrote:[color=blue][color=green]
> >In my example, it was b[1]+=1. "+=1" should at least tell Python two
> >things: this is an add operation and one of the operands is an
> >integer.[/color]
>
> Why would it tell Python that?[/color]
Well, the rhs of 'foo+=1' is always an integer.
Gerrit.
--
Weather in Lulea / Kallax, Sweden 26/11 17:20:
-8.0°C wind 6.7 m/s NW (34 m above NAP)
--
In the councils of government, we must guard against the acquisition of
unwarranted influence, whether sought or unsought, by the
military-industrial complex. The potential for the disastrous rise of
misplaced power exists and will persist.
-Dwight David Eisenhower, January 17, 1961
Peter Hansen wrote:[color=blue][color=green]
> >In my example, it was b[1]+=1. "+=1" should at least tell Python two
> >things: this is an add operation and one of the operands is an
> >integer.[/color]
>
> Why would it tell Python that?[/color]
Well, the rhs of 'foo+=1' is always an integer.
Gerrit.
--
Weather in Lulea / Kallax, Sweden 26/11 17:20:
-8.0°C wind 6.7 m/s NW (34 m above NAP)
--
In the councils of government, we must guard against the acquisition of
unwarranted influence, whether sought or unsought, by the
military-industrial complex. The potential for the disastrous rise of
misplaced power exists and will persist.
-Dwight David Eisenhower, January 17, 1961
Comment