473,813 Members | 3,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Would this be called a bug in inspect ?

Gabriel Genellina wrote:
En Tue, 30 Sep 2008 14:57:55 -0300, Stef Mientki
<st**********@g mail.comescribi ó:
>I'm not familiar with inspect,
but I get an error (see below) in
getmembers ( wx )

Of course this is bug in wx .

Yes.
>But would you also call this a bug in inspect ?
(inspect crashes and doesn't continue with th rest of the code, nor
it returns the already gathered data)

getmembers works fine; try m=getmembers(wx ) and see.
REALLY GREAT !
It fails when you attemp to print (or pprint) the returned list.
But this is fully beyond my understanding:

m = getmembers ( wx )
print m
runs fine
print getmembers ( wx )
crashes

but not always:
>>print getmembers (wx)
[('ACCEL_ALT', 1), ('ACCEL_CMD', 2), ('ACCEL_CTRL', 2), ('ACCEL_NORMAL' ,
0), ('ACCEL_SHIFT', 4), ('ADJUST_MINSIZ E', 0), (

And to make it even weirder, now I can let your suggestion crash too
>>m=getmembers( wx)
print getmembers (wx)
Traceback (most recent call last):
File "<interacti ve input>", line 1, in <module>
File "P:\Python\lib\ site-packages\wx-2.8-msw-unicode\wx\_gdi .py", line
242, in __repr__
def __repr__(self): return 'wx.Colour' +
str(self.Get(Tr ue))
File "P:\Python\lib\ site-packages\wx-2.8-msw-unicode\wx\_gdi .py", line
230, in Get
return _gdi_.Colour_Ge t(*args, **kwargs)
TypeError: in method 'Colour_Get', expected argument 1 of type 'wxColour *'
>>print m
Traceback (most recent call last):
File "<interacti ve input>", line 1, in <module>
File "P:\Python\lib\ site-packages\wx-2.8-msw-unicode\wx\_gdi .py", line
242, in __repr__
def __repr__(self): return 'wx.Colour' +
str(self.Get(Tr ue))
File "P:\Python\lib\ site-packages\wx-2.8-msw-unicode\wx\_gdi .py", line
230, in Get
return _gdi_.Colour_Ge t(*args, **kwargs)
TypeError: in method 'Colour_Get', expected argument 1 of type 'wxColour *'

??????
thanks,
Stef
Sep 30 '08 #1
0 1653

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

Similar topics

1
1649
by: Florian Link | last post by:
Purpose: Dynamically multiplex PyMethodDefs to QT Slots Hi, I would like to create a PyObject using the C API which can dispatch calls to it's methods to just ONE C function, which then forwards the call depending on the method name and argument types/number to other classes.
1
2563
by: Thomas Guettler | last post by:
Hi, the line numbers of inspect.getinnerframes are different from traceback.format_exception. This results in wrong lines being shown in cgitb. An example is below. I looked at the source of both methods. One uses f_lineno (wrong)
11
3961
by: It's me | last post by:
I discovered the hardway what inspect.isclass() is doing. Consider this no brainer code: ### import inspect class Abc: def Hello(self): return
4
2657
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 (I've already done that), importing all of them, and then introspecting on each module to discover its functions, globals and classes. But for now I am having a problem with the latter. I would like to import a module and figure out the names of...
20
1576
by: alainpoint | last post by:
Hi I wonder if Python is capable of the following: define a function which returns its argument. I mean: def magic_function(arg): ...... some magic code ... that behaves the following way:
2
2223
by: 63q2o4i02 | last post by:
Hi, I've written a top-down recursive decent parser for SPICE circuit descriptions. For debugging purposes, I wanted each production rule/function to know what its own name was, so at the beginning of each rule/function, I make a call to inspect.stack() (I think...) and that fetches the name from someplace. However, with a bunch of test text input, this takes ~10 seconds to run. When I comment out the inspect.stack() function from each...
11
1444
by: Michele Simionato | last post by:
The subject says it all, I would like a script to act differently when called as $ python script.py and when called as $ python -i script.py. I looked at the sys module but I don't see a way to retrieve the command line flags, where should I look? TIA, Michele Simionato
4
1388
by: Chris Pax | last post by:
Hello, I recently been trying to use the inspect module to inspect the arguments of gtk objects, such as gtk.Button. I tried like this: inspect.getargspec(gtk.Button.__init__) and get the fallowing error: File "<stdin>", line 1, in <module>
0
892
by: Stef Mientki | last post by:
hello, I'm not familiar with inspect, but I get an error (see below) in getmembers ( wx ) Of course this is bug in wx . But would you also call this a bug in inspect ?
0
192
by: Gabriel Genellina | last post by:
En Tue, 30 Sep 2008 14:57:55 -0300, Stef Mientki <stef.mientki@gmail.com> escribió: Yes. getmembers works fine; try m=getmembers(wx) and see. It fails when you attemp to print (or pprint) the returned list.
0
9607
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10407
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10424
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10140
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9224
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7684
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5706
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3885
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.