[albatross-users] Exception: set_page() passing wrong number of parameters to page_enter()?

Sheila King sheila at thinkspot.net
Tue May 20 17:08:28 EST 2003


--On Tuesday, May 20, 2003 9:29 AM +1000 Gregory Bond <gnb at itga.com.au> 
wrote:

>> self.app.page_enter(self, args)
>
> You are forgetting the implicit hidden "self" argument that all member
> functions get.

Not at all.

Please review the error message given. Two arguments expected. Three given.

self = #1
if () represented a tuple, then that was only a second argument, and not 
three given.
If ( ) represented two separate arguments (a '(' and a ')') then that was 
two arguments. I know it makes no sense for () to represent two arguments, 
but the error message made no sense to me so...grasping at anything.

>  So this is a call to the page_enter() routine of the app
> object.  The args are the app object, an app_context object ("self" in
> the  above code) and the empty tuple () in args.
>
> [This is a python-ism, not an albatross-ism.]

Right. I'm aware of how class functions work. Course, I'm certainly capable 
of making a goof-up and forgetting about self. I just didn't this time.

>
> Which doesn't help to explain your unexpected exception, tho.  I've not
> used  Random apps nor Modular apps, let alone RandomModular apps!
>
> Are you sure you are using a ModularApp and not a SimpleApp?  Are you
> using  the correct AppContext type?

Yes. I showed the complete app in the originating post in this thread. I am 
using the correct class app and context (I believe). At least, no one else 
has called me on it in this discussion.

-- 
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org




More information about the Albatross-users mailing list