The simplest and best option here is to store the objects in a
dictionary with their keys being the generated names.
Thanks. Indeed Alex, that may well be the simplest way, to have an
overarching Dictionary of references/names and objects.
However this does not help me to use the
On Oct 29, 11:31 pm, ShanMayne [EMAIL PROTECTED] wrote:
However this does not help me to use the reference/name of an object I
imported instead of created.
I've never really understood these requests (and they come up a lot).
Unless you're doing a '*' import, you'll already know the bound names
Indeed they do. My delighted thanks. You have most precisely addressed
the problem I intended to convey.
I should have given the case of module attributes a moments further
thought, an obvious answer. The locals() was unknown to me (rookie
gaps).
Thank you for the elaborated illustration.
good
Steve Holden [EMAIL PROTECTED] wrote:
That explanation makes no sense. Given the assignment:
x = 57
if the name of x isn't 'x', then what on earth can it possibly mean to
ask for the name of a variable?
He didn't ask for the name of a variable, he asked for the name of an
object. You
I would like to create objects with algorithmically determined names
based on other object names and use object names for general algorithm
input.
How would one extract the name of an object from an object instance as
a string. I would think that it is stored as an attribute of the
object but
Shannon Mayne wrote:
I would like to create objects with algorithmically determined names
based on other object names and use object names for general algorithm
input.
How would one extract the name of an object from an object instance as
a string. I would think that it is stored as an
On Oct 28, 2008, at 8:41 AM, Shannon Mayne wrote:
I would like to create objects with algorithmically determined names
based on other object names and use object names for general algorithm
input.
What do you mean by the name of an object? Objects don't generally
have names, unless you
On Tue, 28 Oct 2008 09:15:50 -0600, Joe Strout wrote:
On Oct 28, 2008, at 8:41 AM, Shannon Mayne wrote:
I would like to create objects with algorithmically determined names
based on other object names and use object names for general algorithm
input.
What do you mean by the name of an
Steven D'Aprano wrote:
On Tue, 28 Oct 2008 09:15:50 -0600, Joe Strout wrote:
On Oct 28, 2008, at 8:41 AM, Shannon Mayne wrote:
I would like to create objects with algorithmically determined names
based on other object names and use object names for general algorithm
input.
What do you
On Oct 28, 2008, at 4:45 PM, Steven D'Aprano wrote:
What do you mean by the name of an object? Objects don't generally
have names, unless you explicitly define a .name property and assign
them names.
(Variables have names, of course, but a variable isn't an object --
it's
just a reference
On Oct 28, 2008, at 6:58 PM, Steve Holden wrote:
Objects in Python *don't* have names. Period. In Python we don't
normally talk about variables anyway, except when speaking loosely, we
talk about binding names. But please don't let this start another
round
of Python programmers don't know
On Oct 29, 12:41 am, Shannon Mayne [EMAIL PROTECTED] wrote:
I would like to create objects with algorithmically determined names
based on other object names and use object names for general algorithm
input.
The simplest and best option here is to store the objects in a
dictionary with their
12 matches
Mail list logo