[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] Moving the music module?



I'm having some second thoughts about how the music module is laid out.
I think the best situation is if the music module is a submodule of the
mixer module. The music is already strongly tied to the mixer. This would
move music from pygame.music to pygame.mixer.music. You currently can't have
one without the other, and this way importing the mixer would always give
you the music also. I think this method also cleans up some uglies in the
way these two modules are initialized.

There's only a few things holding me back from going and changing
this right now...

A- it breaks code
        not really worried about that at this point, but it is considered.
B- module names getting a bit wordy
        this one's got me a little more concerned. typing pygame.mixer.music
        a bunch of times might be sending people to the hospital for carpal-
        tunnel repair. currently, the full module prefixes (pygame.XXXXX) are
        not bothering me. the only time i dislike them is when i'm using the
        interactive interpreter for quick debugging. but at that point i just
        use the new import arguments, "import pygame.mixer as mix". of course
        when i test in the interactive mode i only use one letter variables
        anyways. i'm just wondering of pygame.mixer.music is pushing things too
        far?
C- no enthusiasm or strong dislike
        i figure the main reason people would think this is a bad idea is
        already covered in concern "B". but there may be things i'm not
        thinking about.

well? what about it? it will clean up the internals and any potential
confusion over how to initialize pygame.mixer and pygame.music. but is
the longer pathname going to be a problem for anyone? i'm not too worried
about the long paths, you don't need to make that many calls to the music
module anyways, even when doing a bunch of sound stuff. people can always
make their own shortcuts to the music module. "music = pygame.mixer.music".

actually, people making their own shortcuts might be a problem as well.
i think handy shortcuts like that are helpful, but i'd also really like
everyone's code to be pretty consistent between programmers. if everyone
takes every pygame project and uses their own set of short module names
things can get a bit unclear.


well, after all that i'm leaning towards about making the change. but
consider me way open-minded here. i want to hear what people think,
not just about the change but feelings on the current way modules are
layed-out/imported would also help me a lot on figuring out where things
are at.


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org