Hidden surface removal not working properly

I’m coding a terrain generator in python using opengl, but opengl’s depth test isn’t working right. It’s not removing surfaces that should be hidden, but others are randomly disappearing as I move around the 3d world. I have this code in my initialization:
glEnable(GL_DEPTH_TEST)
glDepthFunc(GL_LESS)
glClearDepth(1.0)

can anyone tell me what might be wrong?

http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Main=45977&Number=230961

wow thanx it works great now