there's been talk of splitting the python source into
something more manageable. after chatting a bit, it seems
to reinforce that a good idea might be to break pysdl into
submodules. these modules all being kept in a pysdl package.
i see three main benefits from a breakup like this.
first, dependencies are less of an issue. since you only
import the modules you need, you end up only linking to
the dependencies you need. if you don't have SDL_mixer
on your system, that's ok, if you don't import the
"sdl.mixer" module you'll never need the base library.
second, it gives external (3rd party) modules equal
footing. i can go and write a Numeric/Surface extension
class and people can use (or not use) it as needed. it
doesn't need to even come with the base pysdl package,
since it can be downloaded and installed as a separate
module. (same with the SDL_gui module out there)
thirdly, it allows for an easy mix of python and C code.
face it, some quick little routines in python can
end up as monsters on the C extension end. the Numeric
package does this very well, mixing C and python code.
there could also be python class wrappings around the
C extension objects. (UserSurface, UserRect, etc)
whew. well, there it is. the idea has me pretty interesting.
if there's any enthusiasm for something like this i'll code
it up and we can try playing with it.
on the python end, things could still be used with little
change if you wanted. of course "from sdl.constants import *"
might be a big change. each module could also be imported
right to the global namespace,
import sdl
sdl.video.set_mode(xxx)
import sdl.video as video
video.set_mode(xxx)
anyways, what are the thoughts? it seems a nice cleanup
to me. anyone want to see it done? i could probably get it
together faster than you think ;]
|