Proposal for adding symbols within Python

Ben Finney bignose+hates-spam at benfinney.id.au
Sun Nov 13 08:48:46 EST 2005


Steven D'Aprano <steve at removethiscyber.com.au> wrote:
> On Sun, 13 Nov 2005 10:11:04 +0100, Pierre Barbier de Reuille wrote:
> > The problem, IMHO, is that way you need to declare "symbols"
> > beforehands, that's what I was trying to avoid by requiring a new
> > syntax.
> 
> If you don't declare your symbols, how will you get the ones that
> you want?
> [...]
> Are you suggesting that the Python language designers should somehow
> predict every possible symbol that anyone in the world might ever
> need, and build them into the language as predefined things?

I believe Pierre is looking for a syntax that will save him from
assigning values to names; that Python will simply assign arbitrary
unique values for these special names. My understanding of the
intended use is that their only purpose is to compare differently to
other objects of the same type, so the actual values don't matter.

What I still don't understand is why this justifies additional syntax
baggage in the language, rather than an explicit assignment earlier in
the code.

-- 
 \      "Smoking cures weight problems. Eventually."  -- Steven Wright |
  `\                                                                   |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list