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 7748839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:53:13+00:00 2026-06-01T10:53:13+00:00

I created two modules, one with def _func(): print hi and another def func():

  • 0

I created two modules, one with

def _func():
    print "hi"

and another

def func():
    print "hi"

When I use the help function on the module including the first function, the help module doesn’t display this function. As opposed the second example where this function shows in the help output. Is there any functional difference aside from the use of the help function?

  • 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-01T10:53:15+00:00Added an answer on June 1, 2026 at 10:53 am

    Yes, there is an (admittedly subtle) difference functionality-wise. Let’s assume you have a module A.py:

    foo = 1
    _bar = 2
    

    Observe:

    >>> from A import *
    >>> foo
    1
    >>> _bar
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name '_bar' is not defined
    

    The default behaviour if you do an import * is that members with a leading underscore are not imported. You can override that behaviour by specifying an __all__ list:

    __all__ = ['foo', '_bar']
    
    foo = 1
    _bar = 2
    

    Now:

    >>> from A import *
    >>> (foo, _bar)
    (1, 2)
    

    By the way, __all__ also overrides the list of members shown by help() or pydoc:

    $ pydoc A | cat
     ...
    DATA
        __all__ = ['foo', '_bar']
        _bar = 2
        foo = 1
     ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three modules as: one.py : def abc(): print "Heeeeeeeeeeeiiiiiioooooooooo" two.py : import
I've created two objects outside the database. One is SERVICES and one is MODULES
I have created two actions in code, one simple and one advanced. function userbeep_action_info()
I've created two classes, with one of them having an implicit cast between them:
I have created two forms in my Windows Application. One Form acts as a
I have created two JavaScript files. One file is "validators.js" and the other is
I have found two modules that save their module specific settings without using sql
I've setup my application with two modules, one for Admin and other for the
I created two tables: Publisher PK, PublisherId, int, not null, indentity +1 PublisherName, varchar(50),
I created two files in the App_GlobalResources folder: SiteResources.en-US.resx SiteResources.sp-SP.resx Both contain a value

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.