Module tp.client.pyscheme.symbol
A simple "symbol" class for Python. Symbols are like strings,
except that symbols should only be comparable to other symbols. This
module is designed so that one should be able to do a "from symbol
import *" on this.
To create a new Symbol, use the Symbol() function, like this:
hello = Symbol("hello")
All symbols are interned so that comparison using 'is' will work. For
example,
Symbol("hello") is Symbol("h" + "ello")
should work.
By default, all symbols are case insensitive, but if the module
variable CASE_SENSITIVE is set to a true value, symbols will become
case sensitive.
Also, we use the UserString to make sure that symbols are of a
different "class" than Strings. isSymbol() depends on this
representation, so be careful about changing it.
| Function Summary |
| |
isSymbol(x)
Returns True if x is already a symbol. |
| |
Symbol(s)
Generates a new Symbol that we guarantee can be compared in
constant time to any other symbol. |
isSymbol(x)
Returns True if x is already a symbol.
-
|
Symbol(s)
Generates a new Symbol that we guarantee can be compared in
constant time to any other symbol.
-
|