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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:00:19+00:00 2026-05-27T19:00:19+00:00

I keep hearing everything is an object in both Ruby and Python world. Well,

  • 0

I keep hearing “everything is an object” in both Ruby and Python world. Well, what are built-in functions then? Can someone explain that in layperson English?
For example:

file=open(abc.txt)

open is a built-in function. Is it an object? Is it a method? Of what class?

How did we even end-up with functions in Python if everything is an object? I mean, shouldn’t we be having class, objects, methods and attributes, instead of functions? I thought we had functions in languages like C. Python, Ruby and Java had classes, objects, attributes, methods.

In Ruby (irb), you could do something like 1.class and this will give you Fixnumit will show you which class it belongs to. I don’t seem to be able to do this in Python shell. Is there an equivalent?

FYI:

  • I am using Python 2.7
  • relatively new to programming so please use layperson English. For instance, I read in one of the answers “But everything is an object in the sense that it can be assigned to a variable or passed as an argument to a function” — no idea what that means.
  • 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-27T19:00:20+00:00Added an answer on May 27, 2026 at 7:00 pm

    They are all listed here: http://docs.python.org/library/functions.html

    The function open is an object (all functions are objects) and belongs to the __builtin__ module. They are simply built-in, and available to all objects, since they are automatically imported (something like from __builtin__ import *).

    >>> print repr(open)
    <built-in function open>
    
    >>> print open.__module__
    __builtin__
    
    >>> import __builtin__
    >>> print __builtin__.open
    <built-in function open>
    

    Update
    You mentioned in your edit that you don’t know what assigning a function means.

    >>> o = open
    >>> print repr(open)
    <built-in function open>
    >>> print repr(o)
    <built-in function open>
    >>> o('file.txt')
    <open file 'file.txt', mode 'r' at 0x107fe49c0>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep hearing a lot about functors in C++. Can someone give me an
I keep hearing from associates about grid computing which, from what I can gather,
I keep hearing all this hype about Twisted for python, but i just find
I'm learning javascript and one thing I keep hearing is functions are objects .
I keep hearing that it's bad practise to store large object collections / anything
I started my college two years ago, and since then I keep hearing design
I keep hearing about LLVM all the time. It's in Perl, then it's in
I'm currently learning Python and coming from a strong C# background. I keep hearing
I keep hearing that div tags should be used for layout purposes and not
I keep hearing that catch (Exception ex) Is bad practise, however, I often use

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.