Equivalent in Python?

Philip Swartzleonard starx at pacbell.net
Mon Apr 29 20:27:17 EDT 2002


James J. Besemer || Mon 29 Apr 2002 03:11:25p:

> 
> Vincent Foley wrote:
> 
>> What's the Python equivalient of Perl's "a"++; ?
> 
> You can't get there from here.
> 
> I.e. there is no practical equivalant.
> 
> Including it would allow deadly side-effects within an expression and
> thus would percipitate the end of the world, or at least mankind.
> 
> Regards
> 
> --jb

But if you just want to increment something, use 'foo+=1'. Exactly the 
same, except one more character and only works on a line of it's own 
(avoiding above said doom... man pointer-walking funcitons in C are nuts 
with that... =)

-- 
Philip Sw "Starweaver" [rasx] :: www.rubydragon.com



More information about the Python-list mailing list