Yeah I understand that. It's just the docs make it seem that the add function will add your sprite to whatever your sprite.layer attribute is if you don't specify a karg layer. But that's not true. If you then use change_layer you end up doing twice as much work since with 'add' and 'change_layer' it's doing a bisect search each time.
The point I'm making is that yes, '_layer' is an internal variable but 'layer' is never used. If you initialize a sprite and you want it to be added correctly then you have to set '_layer' before adding. Yes, don't change the '_layer' attribute after adding.
If we wanted to keep '_layer' strictly an internal variable then we need to add a bit that gets the 'layer' attribute as it says it will in the docs. Below it looks for a karg layer, '_layer' and then 'layer' before using the default.
if layer is None:
try:
layer = sprite._layer
except AttributeError:
try:
layer = sprite._layer = sprite.layer
except AttributeError:
layer = sprite._layer = self._default_layer
elif hasattr(sprite, '_layer'):
sprite._layer = layer
I hope that clarifies my point.
Jeffrey