Just use this code:
>>> import pygame
>>> from pygame import *
>>> pygame.init()
(6, 0)
>>> pygame.display.gl_set_attribute(GL_DEPTH_SIZE, 16)
>>> pygame.display.set_mode((640,480), OPENGL|DOUBLEBUF )
>>> print "ZBUFFER is:" ,pygame.display.gl_get_attribute(GL_DEPTH_SIZE)
ZBUFFER is: 24
>>> print "Driver is:", pygame.display.get_driver()
Driver is: x11
NOTE: The OpenGL flags are;
GL_ALPHA_SIZE, GL_DEPTH_SIZE, GL_STENCIL_SIZE, GL_ACCUM_RED_SIZE,
GL_ACCUM_GREEN_SIZE, GL_ACCUM_BLUE_SIZE, GL_ACCUM_ALPHA_SIZE,
GL_MULTISAMPLEBUFFERS, GL_MULTISAMPLESAMPLES, GL_STEREO
You can see more here.