GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • [Python-Dev] Python 1.6 timing
  • [ date ]
  • [ thread ]
  • [ subject ]
  • [ author ]

This view

  • Original page
  • New address

GeezerVison is showing mail.python.org — Python 2 namespace change? (was Re: [Python-Dev] Changing existing class instances)

Python 2 namespace change? (was Re: [Python-Dev] Changing existing class instances)

Tim Peters [email protected]
Sat, 22 Jan 2000 18:18:11 -0500

  • Previous message: Python 2 namespace change? (was Re: [Python-Dev] Changing existing class instances)
  • Next message: [Python-Dev] Python 1.6 timing
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

[Jim Fulton]
> ...
> A change to the way that namespaces are handled
> could make this work and have a number of other benefits,
> like global name usage without namespace lookups.
>
> I've suggested this to Guido in the past.  His
> reasonable response is that this would be too big a
> change for Python 1. Maybe this is something to consider
> for Python 2?
>
> The basic idea (borrowed from Smalltalk) is to have a kind
> of dictionary that is a collection of "association"
> objects.  An association object is simply a pairing of a
> name with a value. Association objects can be shared among
> multiple namespaces.

Jim, I've been intrigued by this idea for all the years you've been
suggesting it <wink>, but I've never understood what it is you're proposing!
This is the Python-Dev list, so feel encouraged to present it in concrete
implementation terms instead of ambiguous English.  Or maybe an interface?

interface a_kind_of_dictionary_that_is_a_collection_of_\
              association_objects:
    # ??? beats me ...

Or maybe as a C struct?  For example, is "an association object" a (char*,
PyObject*) pair?

Does this kind of dictionary have keys?  If so, of what type?  What type are
the values?  Best I can make sense of the above, the values are "association
objects", each of which contains a name and a value, and a key is maybe a
duplicate of the name in the association object to which it maps.  "A name"
may or may not be a string -- I can't tell.  Or maybe by "dictionary" you
didn't intend Python's current meaning for that word at all.  I assume "a
value" is a PyObject*.  The whole thrust *appears* to be to get names to map
to a PyObject** instead of PyObject*, but if that's the ticket I don't know
what association objeects have to do with it.

> An import like:
>
>   from foo import spam
>
> would copy the association between the name 'foo' and a
> value from module 'spam' into the current module.

Where does the idea that 'spam' is a *module* here come from?  It doesn't
make sense to me, and I'm so lost I'll spare everyone my further confusions
<wink>.

suspecting-the-last-actually-doesn't-make-any-sense<wink>-ly
    y'rs  - tim





  • Previous message: Python 2 namespace change? (was Re: [Python-Dev] Changing existing class instances)
  • Next message: [Python-Dev] Python 1.6 timing
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.