Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #36919 > unrolled thread
| Started by | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| First post | 2013-01-16 19:30 -0500 |
| Last post | 2013-01-16 19:30 -0500 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: cymbalic reference? Terry Reedy <tjreedy@udel.edu> - 2013-01-16 19:30 -0500
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2013-01-16 19:30 -0500 |
| Subject | Re: cymbalic reference? |
| Message-ID | <mailman.583.1358382627.2939.python-list@python.org> |
On 1/16/2013 4:06 PM, rh wrote:
> My final product uses your suggestions along with one from the other post.
> I like the idea of storing the class name as the key. Then no call to globals()
> is needed. But I still have to test how that object behaves when it's a key.
> i.e. Is it deeply bound? Shallow? Tight? Loose? Not sure which is the correct
> term!
The only effect on an object of making it a dict key is that it cannot
disappear.
class C: pass
d = {C: 'C'}
del C
# The name 'C' can no longer be used to access the class
# However, the class cannot be deleted because it is in use
for c in d: print(c)
> So maybe I want {Abc:'http://example.com'} and o = s() instead.
Yes, as I suggested.
--
Terry Jan Reedy
Back to top | Article view | comp.lang.python
csiph-web