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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:51:39+00:00 2026-06-16T03:51:39+00:00

Ipython 0.13.1 can print the source of an object from python library, such as,

  • 0

Ipython 0.13.1 can print the source of an object from python library,
such as, os.path.abspath??
But I can’t print the source code of any object I defined through %ed magic in ipython,
Is anything wrong I did?
such as, I define a class Name through %ed magic:

%ed  

then

class Name(object):
    """docstring for Name"""
    name = 'hong'
    def __init__(self, arg):
        super(Name, self).__init__()
        self.arg = arg
    def pri():
        print 'class Name'

when back to ipython, I can’t see the source code of class Name:

In [59]: Name??
Type:       type
String Form:<class '__main__.Name'>
Docstring:  docstring for Name
Constructor information:
Definition:Name(self, arg)

Is this the bug of IPython?

  • 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-16T03:51:40+00:00Added an answer on June 16, 2026 at 3:51 am

    –Edits after OP mentioned this is seen in ipython iteself.

    Is there any error message you get after typying %ed myfunc? Pasting that might help others find the issue.

    —update:

    I also get a short version of the source code when I try Name??, but Name.pri?? gives me the full source code of the pri() member function of the Name class. So ipython may have some convention to not give full source code of classes.

    Here is my interaction:

        In [2]: Name??
        Type:       type
        String Form:<class '__main__.Name'>
        Docstring:  docstring for Name
        Constructor information:
         Definition:Name(self, arg)
    
        In [3]: Name.pri??
        Type:       instancemethod
        String Form:<unbound method Name.pri>
        File:       /tmp/ipython_edit_8YOfN9.py
        Definition: Name.pri()
        Source:
            def pri():
                print 'class Name'
    
        In [4]:
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using IPython .10-2, I can do the following from a python command line program:
From my ipython shell, I see a method setdefault in os.environ but it is
When I launch IPython Notebook I can navigate to it and enter code. However,
When I am in an interactive python session (usually IPython), the following commands: from
I am trying to migrate over to Python from Matlab and can't figure out
The ipython python shell has a wonderful feature, whereby you can type: foo?? and
Really annoying problem in ipython prompt in emacs: In [128]: if 1==1: .....: print
I am using IPython 0.12.1 notebook to connect from a Windows machine to a
Here's the SymbolType package that adds symbols to Python. Can those who have done
When studying a snippet of unknown Python code, I occasionally bump into the varName.methodName()

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.