kirk at strauser.com
Fri Jun 11 23:45:06 CEST 2004
-----BEGIN PGP SIGNED MESSAGE-----
At 2004-06-11T20:47:44Z, "Robert Brewer" <fumanchu at amor.org> writes:
> Some options:
> 1) Override __init__ in the subclass.
Sigh. I'd wanted to avoid that, but I guess I can make it a thin wrapper.
> 2) Pass the correct module as an argument to init.
> 3) Perform ugly module-inspection hacks. Don't do this.
> It would be a *lot* clearer if your example didn't re-use names in
> different modules.
OK, then, I shall again ask advice. I foresee having 10-15 completely
distinct classes for clients to choose from. I don't want to end up in the
position where a client program has to know that if it's importing
FtpEdiFiles, then it has to use the FtpEdiFileRetriever class, but if it's
importing ScpPngFiles, then it has to use the ScpPngFileRetriever class. I
really want to use the same class name across all of the modules unless
doing otherwise is unavoidable. What's a good way to handle this?
The Strauser Group
Open. Solutions. Simple.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the Python-list