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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:47:20+00:00 2026-06-10T12:47:20+00:00

In cherryPy for example, there are files like: __init__.py _cptools.py How are they different?

  • 0

In cherryPy for example, there are files like:

  • __init__.py
  • _cptools.py

How are they different? What does this mean?

  • 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-10T12:47:21+00:00Added an answer on June 10, 2026 at 12:47 pm

    __...__ means reserved Python name (both in filenames and in other names). You shouldn’t invent your own names using the double-underscore notation; and if you use existing, they have special functionality.

    In this particular example, __init__.py defines the ‘main’ unit for a package; it also causes Python to treat the specific directory as a package. It is the unit that will be used when you call import cherryPy (and cherryPy is a directory). This is briefly explained in the Modules tutorial.

    Another example is the __eq__ method which provides equality comparison for a class. You are allowed to call those methods directly (and you use them implicitly when you use the == operator, for example); however, newer Python versions may define more such methods and thus you shouldn’t invent your own __-names because they might then collide. You can find quite a detailed list of such methods in Data model docs.

    _... is often used as ‘internal’ name. For example, modules starting with _ shouldn’t be used directly; similarly, methods with _ are supposedly-private and so on. It’s just a convention but you should respect it.

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

Sidebar

Related Questions

I have a web app served by cherrypy. Within this app, I would like
I found many examples for older versions of CherryPy but they each referenced importing
I have a cherrypy server distributing xml files to webpages. While my server runs,
When you start/stop a python cherrypy service (compiled with py2exe), this works fine When
I am running a server with cherrypy and python script. Currently, there is a
I have one server located at example.com running apache, serving my static html files.
I need a simple example of invoking the cherrypy.process.plugins.BackgroundTask . I tried it out
I am using cherrypy as a server. This server gives you ability to download
I found an article for CherryPy and some articles on how to do this
I tried the Routes Dispatcher example in cherrypy essentials but its not working. its

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.