[Tutor] objects becoming pointers
roadierich at googlemail.com
Wed Jul 15 17:33:00 CEST 2009
2009/7/15 chris Hynes <cjhynes36 at hotmail.com>:
> I guess I have to start somewhere to ask............
> I want the user to input a name, say "Chris". I know I can use the code:
> I now want:
> so that when I type:
> print Chris
> the return will be an array of zero's 3x3
> So that I can understand this deeper, I know that "name" is just a pointer
> to the object "Chris". I don't want to just change the pointer to something
> else, like "zeros((3,3))" but I want to make "Chris" become the pointer or
> the name of the pointer. At least that's what I think I want.
> Windows Live™ SkyDrive™: Get 25 GB of free online storage. Get it on your
> BlackBerry or iPhone.
> Tutor maillist - Tutor at python.org
Sorry if I've sent this twice...
Why would you want to do that?
The closest you can get to that is using exec, but exec is usually
considered a code smell. I'd say you're trying to do the wrong thing.
Rich "Roadie Rich" Lovely
There are 10 types of people in the world: those who know binary,
those who do not, and those who are off by one.
More information about the Tutor