Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 892143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:00:19+00:00 2026-05-15T14:00:19+00:00

Here’s the SymbolType package that adds symbols to Python. Can those who have done

  • 0

Here’s the SymbolType package that adds symbols to Python. Can those who have done anything useful with Lisp/Scheme tell me what how can I take advantage of this type in Python?

Can it be used to isolate strings coming from outside (from the web) from internal code?

$ sudo easy_install SymbolType
$ ipython

Unfortunately, you can’t use symbols to pass values as kwargs:

In [7]: X = s('X', __name__)
In [9]: a = {X: 10}
In [12]: Y = s('Y', __name__)
In [13]: a.update({Y: 20})
In [14]: a
Out[14]: {X: 10, Y: 20}

In [15]: for (k, v) in a.items():
   ....:     print k, v

Y 20
X 10

In [16]: def z(X=0,Y=1):
   ....:     print X, Y
   ....:     

In [17]: z(**a)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

...<ipython console> in <module>()

TypeError: z() keywords must be strings
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:00:19+00:00Added an answer on May 15, 2026 at 2:00 pm

    Symbols are not a replacement for strings. While both are represented by a
    sequence of characters, a symbol shouldn’t be used in place of a string when
    this is the dominant property. Symbols represent a unique identity.
    This means that pointer equality
    (instead of content equality) can be used to compare them.
    For this reason, symbols are often used as constants, enumeration elements, hash table keys
    or identifiers (in lisp).

    In Lisp, the first time you reference a symbol, a corresponding entry in the
    symbol table is created. If the same symbol is referenced thereafter,
    it will be looked up and represent the same value.

    I’m not a Python programmer, but since symbols are not built into
    the Python language, their use may be limited or not very convenient.
    You shouldn’t use them for isolating strings. Use a wrapper class for that.

    Edit: reading through the SymbolType docs, i saw that they bundle the originating
    namespace (through __name__). Common Lisp does that, too. One might be able to use this
    facility in some fashion.

    Also read this question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here's a coding problem for those that like this kind of thing. Let's see
Here's the setup - I have a view that lists products. On that same
Here is a scenario: User installs .NET application that you have made. After some
Here is my code (Say we have a single button on the page that
Here is my problem...I have a page that loads a list of clients and
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the scenario: I'm writing an app that will watch for any changes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.