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

argument list

Dear Python List,

I am working on a solution embedding Python in an app that will looks for
specific string combination within the function names to determine if a
handler for an event exists; I have been able to extract the function names
and find all of the 'fields' of interest. What I am concerned about,
however, is that they could have the wrong argument profile, as specific
handlers will have specific function arguments - can I find out what
arguments a specific functions takes from the C-API? As I don't seem to be
able to find anything...but I could be just being blind...

Thanks...

--
Phil Hornby
Jul 18 '05 #1
2 1579

"Phil Hornby" <ph*********@accutest.co.uk> wrote in message
news:ma************************************@python .org...
Dear Python List,

I am working on a solution embedding Python in an app that will looks for
specific string combination within the function names to determine if a
handler for an event exists; I have been able to extract the function names and find all of the 'fields' of interest. What I am concerned about,
however, is that they could have the wrong argument profile, as specific
handlers will have specific function arguments - can I find out what
arguments a specific functions takes from the C-API? As I don't seem to be
able to find anything...but I could be just being blind...
Look at the inspect module. That's the best you can do;
exact type information simply isn't availible.

The times I've actually needed this I've simply built a metadata
dictionary into the affected classes using a fixed name. So far,
I've only needed it twice, so I don't have a real good feel for the
"best" structure for such a facility.

John Roth
Thanks...

--
Phil Hornby

Jul 18 '05 #2
"Phil Hornby" <ph*********@accutest.co.uk> writes:
I am working on a solution embedding Python in an app that will looks for
specific string combination within the function names to determine if a
handler for an event exists; I have been able to extract the function names
and find all of the 'fields' of interest. What I am concerned about,
however, is that they could have the wrong argument profile, as specific
handlers will have specific function arguments - can I find out what
arguments a specific functions takes from the C-API? As I don't seem to be
able to find anything...but I could be just being blind...

[...]

First, maybe what you really want is just the equivalent of
func(*args, **kwds)? (don't remember off the top of my head how to do
that)

Or maybe what you're missing is that you can just use different method
naming conventions for different kinds of handler?
John
Jul 18 '05 #3

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

Similar topics

5
by: Paul Sweeney | last post by:
The python tutorial gives the following example to demonstrate the fact that default args are only evaluated once: def f(a,L=): L.append(a) return L print f(1),f(2),f(3)
8
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer...
8
by: BekTek | last post by:
I have class that has member function that take two argument.. I'd like to use the member function to algorithm such as remove_if.. How can I bind that? class Foo{ void f(){ int a = 10;...
7
by: | last post by:
How to call a function with variable argument list from another function again with variable argument list? Example : double average ( int num, ... ); double AFunct1 ( int num, ... ); double...
5
by: Booted Cat | last post by:
I've seen lots of discussions on the proposed inclusion of "function call with named arguments" to C/C++ on these newsgroups. My proposal is slightly different in that: * No ANSI approval is...
6
by: Bernhard | last post by:
Hello, I would like to build a small interpreter (in an c-program), which calls functions with user-defined arguments. To do this, I have a list of functions names (in an array), with the...
10
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language...
20
by: Chris | last post by:
I'm not sure if this has been done before, but I couldn't easily find any prior work on Google, so here I present a simple decorator for documenting and verifying the type of function arguments....
8
by: A. Anderson | last post by:
Howdy everyone, I'm experiencing a problem with a program that I'm developing. Take a look at this stack report from GDB - #0 0xb7d782a3 in strlen () from /lib/tls/i686/cmov/libc.so.6 #1 ...
7
by: Brentt | last post by:
Hi, I know this is a terribly simple question, but the docs seem to be designed for people who probably find a the answer to this question terribly obvious. But its not at all obvious to me. I...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.