durusmail: quixote-users: calling arguments
calling arguments
2002-08-05
2002-08-05
2002-08-05
2002-08-05
2002-08-06
2002-08-06
2002-08-06
calling arguments
Greg Ward
2002-08-06
On 06 August 2002, Andreas Kostyrka said:
> Well, it always take some definition of magic. If you take the uninited
> CGI perl coder, than the namespace traversal already looks like magic.

True, but Quixote was written by and for clueful, experienced Python
programmers.  Anything that feels like magic to Andrew, Neil, and me is
too magical.  Groping through function objects and looking at parameter
names feels like magic to me.

> Line count: My (at the moment) naive implementation takes:
> andreas@vaio2:~/work/fax> wc -l reqpublish.py
>     106 reqpublish.py
> Only 52 lines are my naive implementation, while the rest includes
> the boilerplate try_publish method, etc.
> It would get some additional lines for :float and other modifiers, at
> the moment it only understands :int.

Like I said, this code will go into Quixote over my dead body.

However, if you find that the organization of Publisher makes it
difficult or awkward for you to add this functionality in a subclass,
feel free to suggest a refactoring.  Don't do so without looking at the
latest CVS version of Quixote -- Andrew recently checked in some
refactoring in the Publisher class.  This might make your life more or
less difficult -- let us know.

(Oh yeah: cvs -d :pserver:anon@cvs.mems-exchange.org:/home/cvs co quixote)

> Conclusion:
> 3 possible ways to proceed:
> a) ignore the thread.
> b) include some hooks to make modifying the behaviour easier:
>    instead of
>        output=object(request)
>    make it something like this:
>        output=self.callrequest(object,request)
>    with
>    def callrequest(self,object,request):
>        return object(request)
>
>    This would make it easier to fix the behaviour.

Oops, should have kept reading.  That sounds reasonable to me -- nice
clean way to allow people like you to hideously pervert Quixote's
simple, obvious model of calling functions.  ;-)

        Greg
--
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org


reply