Re: Magic function

2008-01-15 Thread Ruediger
[EMAIL PROTECTED] wrote: > Hi Rüdiger, > > Thanks for your message. I liked your approach and I've been trying > something along exactly these sorts of lines, but I have a few > problems and queries. > > The first problem is that the id of the frame object can be re-used, > so for example this

Re: Magic function

2008-01-14 Thread dg . google . groups
Hi Rüdiger, Thanks for your message. I liked your approach and I've been trying something along exactly these sorts of lines, but I have a few problems and queries. The first problem is that the id of the frame object can be re-used, so for example this code (where I haven't defined InstanceTrac

Re: Magic function

2008-01-13 Thread R�diger Werner
Well as I understand your problem now, you would not like all instances of an specific object that are still alive, but all references to an object (created somewhere, sometimes) in an local context (stack frame), that are accessible from 'that' context ( but also from many others). However in pyt

Re: Magic function

2008-01-12 Thread dg . google . groups
Thanks everyone for the comments. I had previously thought about the possibility of the classes keeping track of their instances. I guess this could probably be done quite transparently with a decorator too (as we have many different types of objects being collected together). The only issue is th

Re: Magic function

2008-01-12 Thread bearophileHUGS
Steven D'Aprano: > As simple as the above is, it could be made simpler. Judging from the > example given, the Bigobj constructor doesn't need a keyword argument, > it could just as easily take an arbitrary number of arguments: > bigobj = Bigobj(obj1, obj2, obj3, obj4...) I agree; "Things should be

Re: Magic function

2008-01-11 Thread Carl Banks
On Fri, 11 Jan 2008 08:29:18 -0800, dg.google.groups wrote: > Hi all, > > I'm part of a small team writing a Python package for a scientific > computing project. The idea is to make it easy to use for relatively > inexperienced programmers. As part of that aim, we're using what we're > calling 'm

Re: Magic function

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 19:36:24 -0800, Michael Tobis wrote: > On Jan 11, 8:40 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: > >> Read the OP's post again. His (her?) users aren't expected to create >> the toolkit, merely to use it. To create good toolkits you need both a >> mas

Re: Magic function

2008-01-11 Thread Michael Tobis
On Jan 11, 8:40 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Read the OP's post again. His (her?) users aren't expected to create the > toolkit, merely to use it. To create good toolkits you need both a master > programmer and an expert in the field. It is an advantage if th

Re: Magic function

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 17:36:10 -0800, Michael Tobis wrote: > On Jan 11, 6:15 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: >> Your users are *scientists*, and you don't trust their intellectual >> ability to learn a programming language as simple as Python? >> >> Instead of spe

Re: Magic function

2008-01-11 Thread Michael Tobis
On Jan 11, 6:15 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Your users are *scientists*, and you don't trust their intellectual > ability to learn a programming language as simple as Python? > > Instead of spending time and effort writing, debugging and maintaining > such a

Re: Magic function

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 08:29:18 -0800, dg.google.groups wrote: > Hi all, > > I'm part of a small team writing a Python package for a scientific > computing project. The idea is to make it easy to use for relatively > inexperienced programmers. ... > This is fine, but we decided that for clarity o

Re: Magic function

2008-01-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > obj1 = Obj(params1) > obj2 = Obj(params2) > ... > run() > > The idea is that the run() function inspects the stack, and looks for > object which are instances of class Obj, creates a Bigobj with those > objects and calls its run() method. > > So, any comments on that

Re: Magic function

2008-01-11 Thread Ruediger
[EMAIL PROTECTED] wrote: > Hi all, > > I'm part of a small team writing a Python package for a scientific > computing project. The idea is to make it easy to use for relatively > inexperienced programmers. As part of that aim, we're using what we're > calling 'magic functions', and I'm a little b

Re: Magic function

2008-01-11 Thread oj
On Jan 11, 4:29 pm, [EMAIL PROTECTED] wrote: > Hi all, > > I'm part of a small team writing a Python package for a scientific > computing project. The idea is to make it easy to use for relatively > inexperienced programmers. As part of that aim, we're using what we're > calling 'magic functions',

Re: Magic function

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 08:29:18 -0800 (PST) [EMAIL PROTECTED] wrote: > Hi all, > > I'm part of a small team writing a Python package for a scientific > computing project. The idea is to make it easy to use for relatively > inexperienced programmers. As part of that aim, we're using what we're > call