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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:01:13+00:00 2026-06-14T17:01:13+00:00

I am learning python but I get confused when I see the functions or

  • 0

I am learning python but I get confused when I see the functions or variables that start with double underscores like:

__getAttributes__ __dict

How can I find all the functions and attributes that start with double underscore so that ? can understand them better?

  • 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-14T17:01:14+00:00Added an answer on June 14, 2026 at 5:01 pm

    Use the dir built- in function. It returns a list of all attributes and methods in a given object. It’s also a great way to quickly discover functionality or recall method names. Example:

    print dir("this is a string")
    
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__
    format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__get
    slice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mo
    d__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
     '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook
    __', '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center',
     'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'index
    ', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper',
    'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', '
    rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', '
    strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
    

    Those methods are usually used by built-in functions or operators. For example __eq__ tests if two objects are equal and is used by all operators and functions that need to compare values.

    There are many articles and guides out there for those “magic methods”, such as http://www.rafekettler.com/magicmethods.html .

    Edit: also check the comments for great official documentation on those methods. They give a nice overview of everything that is available.

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

Sidebar

Related Questions

I'm learning basic Boolean logic with Python. I understand the equality operators but get
I am learning multithreading and sockets on Python but I came across a problem.
I have committed to learning C now, I'm good with Python/PHP/Bash but I've decided
I started programming in Python on Monday. I have enjoyed learning it. But I
I've been learning Python for several months but now finding some problems with my
I'm having a great time learning Python, but I've just gotten a bit stuck
I have been here for a couple of months learning python from examples, but
I've just started learning Python and I'm slowly getting the hang of it, but
I'm learning Python, and I can easily create a server on localhost, but other
I am learning Python and am reading through an example script that includes some

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.