Can I reference 1 instance of an object by more names ?

Terry Reedy tjreedy at udel.edu
Tue May 22 20:11:29 EDT 2007


"Stef Mientki" <S.Mientki-nospam at mailbox.kun.nl> wrote in message 
news:f0b3e$46537f87$d443bb3a$20034 at news.speedlinq.nl...
|     port_D = IO_port('D')
|
| Now I want to assign a more logical name to that port,
| (In JAL: "var byte My_New_Name IS port_D")
|
| Is that possible ?
|
| I think the answer is "no",
| because the object itself is not mutable.
| Am I right ?

no

| But I read: "An object can have any number of names, or no name at all."
| So am I wrong ?

yes
Believe the docs.
Use the interactive interpreter to try things for yourself:
port_nice_name = port_awkward_name
!

Terry Jan Reedy






More information about the Python-list mailing list