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

  • Home
  • SEARCH
  • 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 9169621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:54:16+00:00 2026-06-17T15:54:16+00:00

Just getting started with Dive Into Python. For some reason I can’t get a

  • 0

Just getting started with “Dive Into Python”. For some reason I can’t get a docstring to display.

#!/usr/bin/env python

def buildConnectionString(params):
    """Build a connection string from a dictionary of parameters
    """
    # Returns string
    return ";".join(["%s=%s" % (k, v) for k, v in params.items()])

if __name__ == "__main__":
    myParams = {"server":   "mpilgrim", \
                "database": "master",   \
                "uid":      "sa",       \
                "pwd":      "secret"    \
                }
    print buildConnectionString(myParams)

At the console:

>>> import odbchelper
>>> print odbchelper.buildConnectionString.__doc__
None
>>> 

This works fine:

>>> import sys
>>> sys.path.__doc__
"list() -> new empty list\nlist(iterable) -> new list initialized from iterable's items"
>>> 

I tried a number of permuations, including """ and # comments. No joy. Where is the problem?

  • 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-06-17T15:54:17+00:00Added an answer on June 17, 2026 at 3:54 pm

    What you have should work; some possible reasons why it is not:

    • You are editing a different file
    • You haven’t exited and restarted the interpreter after editing the correct file

    Update:

    If you use reload to avoid exiting and restarting the interpreter (or IDLE or whatever you are using) you need to be aware of a couple pitfalls:

    • reload is not recursive

    In other words, if your odbchelper imports odbcstuff and you reload(odbchelper), odbcstuff will not be reloaded.

    • reload does not update other existing objects

    If you try to get around the non-recursive nature of reload with

    import odbcstuff
    reload(odbcstuff)
    

    the odbcstuff that odbchelper sees is still the old one; you need one more step:

    odbchelper.odbcstuff = odbcstuff     # update odbchelper with the reloaded odbcstuff
    

    As you can see, that would be quite tedious for more than a couple dependent modules. So go ahead and use reload, but if things are still not working correctly, exit and restart.

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

Sidebar

Related Questions

Just getting started with MSpec and I can't seem to quite get my first
Just getting started with WF4. Ran into a problem with passing some text from
I am just getting started couchdb and have been looking into writing couch apps.
I'm just getting started with LINQ, and I'm having some troubles. Say I wanted
Just getting started here and cannot seem to get this very basic thing working.
Just getting started with jQuery, and I've had some success so far. I've created
I'm just getting started with python so please bear with me ;) While following
I'm just getting started with Visual Studio (2010 Beta) and have some basic questions
Just getting started on Scala Actors. The Scala website says: Thread-blocking operations can be
I'm just getting started with M-V-VM and WPF and having issues understanding some binding

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.