473,320 Members | 1,821 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,320 software developers and data experts.

Traversing the object space.

Ruby has a nice function that can traverse the complete object space
of your program.

Is there anything like this in python ? It seems to be not in the
standart library but maybe i can find a short script somewhere else.

It is a nice way for to do some memory checks to find out if a part of
your app is generating too much objects.
Jul 18 '05 #1
3 1350
On Mon, Sep 01, 2003 at 11:31:45AM -0700, Lothar Scholz wrote:
Ruby has a nice function that can traverse the complete object space
of your program.

Is there anything like this in python ? It seems to be not in the
standart library but maybe i can find a short script somewhere else.

It is a nice way for to do some memory checks to find out if a part of
your app is generating too much objects.

import gc
print gc.get_objects()

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


--
"Pascal is Pascal is Pascal is dog meat."
-- M. Devine and P. Larson, Computer Science 340

Jul 18 '05 #2
> > Ruby has a nice function that can traverse the complete object space
of your program.

Is there anything like this in python ? It seems to be not in the
standart library but maybe i can find a short script somewhere else.

It is a nice way for to do some memory checks to find out if a part of
your app is generating too much objects.

import gc
print gc.get_objects()


Does this only report objects that support the garbage collector?
Jul 18 '05 #3
ll*****@web.de (Lothar Scholz) writes:
Ruby has a nice function that can traverse the complete object space
of your program.

Is there anything like this in python ?


In a debug build, there's sys.getobjects(). In recent release builds,
there's gc.get_objects() which I think only returns containers, but a
bit of creativity can find all objects from there (note that, unless
you try really hard instances of any classes you define will count as
containers).

Cheers,
mwh

--
ARTHUR: Why should he want to know where his towel is?
FORD: Everybody should know where his towel is.
ARTHUR: I think your head's come undone.
-- The Hitch-Hikers Guide to the Galaxy, Episode 7
Jul 18 '05 #4

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

Similar topics

3
by: Plamen Valtchev | last post by:
This is my problem: From JavaScript I want to find the list of all defined/loaded JavaScript functions/objects/names within the current scope (html page in a browser). the page could contain...
1
by: alfred | last post by:
Hi my question is on traversing a tree with DOM. how would I be able to traverse 2 trees at the same time. I have 2 XML documents, with similar nodes. I would like to traverse 1 xml document,...
4
by: plmanikandan | last post by:
Hi, I am new to link list programming.I need to traverse from the end of link list.Is there any way to find the end of link list without traversing from start(i.e traversing from first to find the...
0
by: df | last post by:
The user control can not be much simple: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="SortOnListByClass.ascx.cs" Inherits="SortOnListByClass" %> <asp:HyperLink ID="SortOnName"...
0
by: freshman | last post by:
# test code: http://pyode.sourceforge.net/tutorials/tutorial3.html # #i want selecting object in pyode test code. # what's wrong? # under modify code # see selectObject() function # pyODE...
0
by: fig000 | last post by:
Hi, I'm pretty new to the new dot.net. I've been able to quickly set up a grid view with page, etc. The gridview is connected to a drop down which changes the gridview's contents based on the...
10
by: Rik | last post by:
Hi all, I usually don't really use javascript, but for a pretty big form, I'm trying the following: I've got arbitrarily deep nested unorderd list, with in every <li3 checkboxes. It's for...
30
by: asit | last post by:
We kno that data can be pushed onto the stack or popped 4m it. Can stack be traversed ??
1
by: somcool | last post by:
I am facing an error while traversing a query in MS Access Details - When I click a button, a form which has the query opens up. There are certain fields which are in the form of combo box in the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.