The title says it all, really.   I am writing functions that deal with pygame.Surface objects from multiple sources. Among other operations, these functions will ensure that the Surface objects they return have been convert()ed at least once (or, according to user preference, convert_alpha()ed), as is required to optimize them for blitting in the current display mode. But I don't want to run the the convert() or convert_alpha() methods needlessly since they create copies of the surface and therefore take up time and memory.  How do I tell whether I need to do it? I have looked at the output of S.get_flags() before and after S = S.convert_alpha() but it doesn't seem to change.  The scalar value of S.get_alpha() does change (from 255 to 0) but I'm not convinced that's meaningful or reliable (and it doesn't solve the problem of knowing whether you have to .convert() in the case where alpha blending is not desired).
I do not believe the existing API provides a way to do this.  I think the intended use is to convert all your surfaces (why wouldn't you?) so you never have to worry about it.
Perhaps it is possible to subclass pygame.Surface and override the convert methods to set a flag in the way you wish.
how can you tell whether convert()/convert_alpha() has already been run on a pygame.Surface?