Not sure how to phrase this question

Arthur ajs at ix.netcom.com
Mon Sep 16 20:08:55 EDT 2002


Arthur:
> Would hate to have to resort to truely understanding
> this stuff to get to where I am hoping to get.
>

Emille:

>It would help to know where that is... ;-)

Something that I guess can be called a simple class factory.  I have a
routine that will analyze *args sufficiently to provide information as to
which class to be called from the ClassFactory to which *args is
passed.

In the end I want to create an instance of the called/returned class, not of
the ClassFactory class.

Ran into the behavior of my original post while playing around with
alternative ways to go.

I'll certainly take a simple solution to my problem - though I think some
elucidation of the behavior in my original post might be of some interest to
folks other than just myself, in any case.

I have posted some other questions/comments as to what I am trying to
accomplish, mostly on tutor.  Seem to be getting alot of blank stares.
Suffice it to say that what I think I am doing is designing a user friendly
interface for scripting, geared to the famous non-programmer.

In short, I want to avoid a lot of named arguments, want to have the user
interface with "argument smart" classes (in the manner of how I think method
overloading generally works), going so far as wanting positional arguments
that are in effect order insensitive.  Give a Intersection class
a plane and a line in any order and it will know what you are trying to get
at. No Intersection(plane=planeinstance, line=lineinstance). No error on
Intersection(planeinstance,lineinstance) because the class has be set up to
receive only (lineinstance, planeinstance).

Like most things with Python, its all quite doable. In fact its pretty much
done in a way that I am satisfied is modular and maintainable.

But for this one last area of confusion.

Sorry you asked?

Art














More information about the Python-list mailing list