473,395 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Extracting name strings from assigned objects

I would like to ask how one might obtain the assigned name of an
assigned object as a string. I would like to use object names as an
algorithmic input.
To demonstrate... So if i have:
>>foo = {}
what can I do to the object 'foo' so as to return the string 'foo'?

Thanks!
Oct 28 '08 #1
2 1159
2008/10/28 Shannon Mayne <sh******@gmail.com>:
I would like to ask how one might obtain the assigned name of an
assigned object as a string.
That's in the FAQ: <http://tinyurl.com/3xkeac>.

--
Cheers,
Simon B.
si***@brunningonline.net
Oct 28 '08 #2
On Tue, 28 Oct 2008 09:23:46 -0700, Shannon Mayne wrote:
I would like to ask how one might obtain the assigned name of an
assigned object as a string. I would like to use object names as an
algorithmic input.
To demonstrate... So if i have:
>>>foo = {}

what can I do to the object 'foo' so as to return the string 'foo'?
There's a lot of confusion there. The object 'foo' is a string, and it
doesn't occur anywhere in your code. The name foo is not an object, it is
a name. Perhaps you meant the object {} (an empty dict)?

The object {} doesn't know what names (note plural) it has been bound
too. It could be bound to one name:

foo = {}

or many names:

foo = bar = baz = flib = {}

or no names at all:

{}
Names are not properties of objects. You can't do what you are trying to
do. If you tell us why you want to do this, perhaps we can suggest a way
to do it.

--
Steven
Oct 28 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: lecichy | last post by:
Hello Heres the situation: I got a file with lines like: name:second_name:somenumber:otherinfo etc with different values between colons ( just like passwd file) What I want is to extract...
2
by: Steve | last post by:
Hi, I have a very long string, someting like: DISPLAY=localhost:0.0,FORT_BUFFERED=true, F_ERROPT1=271\,271\,2\,1\,2\,2\,2\,2,G03BASIS=/opt/g03b05/g03/basis,...
1
by: Cognizance | last post by:
Hi gang, I'm an ASP developer by trade, but I've had to create client side scripts with JavaScript many times in the past. Simple things, like validating form elements and such. Now I've been...
16
by: sneill | last post by:
How is it possible to take the value of a variable (in this case, MODE_CREATE, MODE_UPDATE, etc) and use that as an object property name? In the following example I want 'oIcon' object to have...
2
by: Chris Belcher | last post by:
First some background... The database tracks Action Items assigned to a group of 20 or so managers. Once the assignment is created it is then emailed to each of the managers that are included in...
20
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt =...
9
by: Jake Barnes | last post by:
I need to change imageUploadInfo2 to caption2 where the number at the end is a variable that needs to be preserved (imageUploadInfo1 to caption1, imageUploadInfo43 to caption43, etc) Can anyone...
12
by: -Lost | last post by:
What in the world is functionName.name good for? That is: function functionName() { return functionName.name; } I mean, I already had to write out the function's name so it seems that it is...
4
by: Debbiedo | last post by:
My software program outputs an XML Driving Directions file that I need to input into an Access table (although if need be I can import a dbf or xls) so that I can relate one of the fields...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.