references/pointers in Python?

Markus Schaber markus at
Wed Sep 12 22:06:48 CEST 2001


Anton Lavrik <asl at> schrub:

> Hi.
> I've Started learning Python, and can't find how can I do something
> like $a = \$b
> or
> $a = \*$b
> in Perl.
> Generally, I want to define a referce to an integer, or to the
> identifier, that holds it.
> Python is full of references, is it possible to define it directly? Or
> maybe there are some different ways to do it?

I don't speak perl, but I hope I can help you:

To create a reference to an integer, just assing it to a name:

a = 3

This creates a reference to the (immutable) integer 3 and assigns it to 
the name a.

"The strength of the Constitution lies entirely in the determination of 
each citizen to defend it. Only if every single citizen feels duty 
bound to do his share in this defense are the constitutional rights 
secure." -- Albert Einstein

More information about the Python-list mailing list