On Wed, 26 Mar 2008 00:27:17 -0700, Arnaud Delobelle wrote:
I'm hardly surprised. The naivety of those who insist that the best
way to understand how new.function and new.code work is to look at the
C source code for object is amusing.
Since 'those who insist...' are just one person, me,
On Wed, 26 Mar 2008 00:55:22 -0700, Arnaud Delobelle wrote:
[snip]
Except it only *appears* to work. What happens if were store the
instances in a list and then execute them all in one go?
Ah yes, nicely spotted. Another solution would be to use a proper factory
function:
def
On Mar 25, 10:55 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Tue, 25 Mar 2008 14:17:16 -0600, j vickroy wrote:
As per your suggestion, I tried looking at include/code.h and
include/funcobject.h (my MS Windows distribution does not appear to
contain .c files).
On Mar 25, 10:55 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
[...]
In my haste I forgot to finish my post:
Here's an example that might help.
class MyClass(object):
pass
records = [spam, ham]
for record in records:
# define a new function
def f(n):
Hello,
Here is some pseudo-code that hopefully illustrates what I want to do:
records = list(...)
for record in records:
new_fcn = define_a function_for(record)
instance = my_new_class_instance()
setattr(instance, 'myfcn', new_fcn)
instance.execute() # instance.execute() calls
On Mar 25, 6:13 pm, j vickroy [EMAIL PROTECTED] wrote:
Hello,
Here is some pseudo-code that hopefully illustrates what I want to do:
records = list(...)
for record in records:
new_fcn = define_a function_for(record)
instance = my_new_class_instance()
setattr(instance, 'myfcn',
Arnaud Delobelle wrote:
On Mar 25, 6:13 pm, j vickroy [EMAIL PROTECTED] wrote:
Hello,
Here is some pseudo-code that hopefully illustrates what I want to do:
records = list(...)
for record in records:
new_fcn = define_a function_for(record)
instance = my_new_class_instance()
En Tue, 25 Mar 2008 17:17:16 -0300, j vickroy [EMAIL PROTECTED]
escribió:
Arnaud Delobelle wrote:
On Mar 25, 6:13 pm, j vickroy [EMAIL PROTECTED] wrote:
Hello,
Here is some pseudo-code that hopefully illustrates what I want to do:
records = list(...)
for record in records:
new_fcn
On Tue, 25 Mar 2008 14:17:16 -0600, j vickroy wrote:
As per your suggestion, I tried looking at include/code.h and
include/funcobject.h (my MS Windows distribution does not appear to
contain .c files). However, since I'm not a C programmer, I did not
find the .h files all that helpful.
I'm
Steven D'Aprano wrote:
On Tue, 25 Mar 2008 14:17:16 -0600, j vickroy wrote:
As per your suggestion, I tried looking at include/code.h and
include/funcobject.h (my MS Windows distribution does not appear to
contain .c files). However, since I'm not a C programmer, I did not
find the .h
10 matches
Mail list logo