473,392 Members | 1,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,392 software developers and data experts.

introspection question

Hi Guys,

What would be the simplest way of enumerating all methods and members
(including inherited) of a given object? Thank you.

Alex
Jan 7 '08 #1
4 986
Alex K wrote:
What would be the simplest way of enumerating all methods and members
(including inherited) of a given object? Thank you.
inspect.getmembers()

Peter
Jan 7 '08 #2
Nice thank you. But anyway to make it look pretty?

On 07/01/2008, Peter Otten <__*******@web.dewrote:
Alex K wrote:
What would be the simplest way of enumerating all methods and members
(including inherited) of a given object? Thank you.

inspect.getmembers()

Peter
--
http://mail.python.org/mailman/listinfo/python-list
Jan 7 '08 #3
2008/1/7, Alex K <sp*********@gmail.com>:
Nice thank you. But anyway to make it look pretty?
pprint.pprint(inspect.getmembers(someobject))
On 07/01/2008, Peter Otten <__*******@web.dewrote:
Alex K wrote:
What would be the simplest way of enumerating all methods and members
(including inherited) of a given object? Thank you.
inspect.getmembers()

Peter
--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list

--
-- Guilherme H. Polo Goncalves
Jan 7 '08 #4
Alex K wrote:

Please don't top-post.
On 07/01/2008, Peter Otten <__*******@web.dewrote:
>Alex K wrote:
What would be the simplest way of enumerating all methods and members
(including inherited) of a given object? Thank you.

inspect.getmembers()
Nice thank you. But anyway to make it look pretty?
Maybe

$ /usr/bin/pydoc -p8080

Otherwise you'd have to explain what you are trying to do.

Peter
Jan 7 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Benjamin Rutt | last post by:
I'm trying to learn about introspection in Python. my ultimate goal is to be able to build a module "text database" of all modules that are in the sys.path, by discovering all candidate modules...
0
by: Steven T. Hatton | last post by:
I suspect the core language is not the level at which introspection should be implemented in C++. That has been the choice of C#, and Java. Both of these languages made some trade-offs to...
4
by: Steven T. Hatton | last post by:
Has there been any substantial progress toward supporting introspection/reflection in C++? I don't intend to mean it should be part of the Standard. It would, nonetheless, be nice to have a...
1
by: James Geurts | last post by:
Hi, Can someone tell me how to test if a field is a const? I am using the FxCop introspection engine, but I suppose I could use reflection if required. for example, the following would return...
2
by: greg.corson | last post by:
Hi, I'm in the process of building a complex system using a sort of "system services" model. I'm looking at putting together various services like serialization, networking, 2D/3D rendering,...
8
by: R. Bernstein | last post by:
In doing the extension to the python debugger which I have here: http://sourceforge.net/project/showfiles.php?group_id=61395&package_id=175827 I came across one little thing that it would be nice...
3
by: James Stroud | last post by:
Hello, I wanted to automagically generate an instance of a class from a dictionary--which might be generated from yaml or json. I came up with this: # automagical constructor def...
14
by: Dave Rahardja | last post by:
Is there a way to generate a series of statements based on the data members of a structure at compile time? I have a function that reverses the endianness of any data structure: /// Reverse...
4
by: mirandacascade | last post by:
Not sure if 'introspection' is the correct term, so apologies if subject line is off-base. 1) Is there any functionality that answers the question: what module am I in? 2) Is there any...
11
by: EricGoogle | last post by:
Hello All, I am trying to figure out a how to get a variable's name from code. Ex: var MYVAR = 3; alert( ????? ); OUTPUT: "MYVAR"
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.