I get what the OP is getting at. I had the same issue. Except that I was creating script/tool that left a file geodatabase as its result. I need to have the tool test to see if this resulting file geodatabase already exists before it creates it. If it exists, it will delete it and create an empty one before proceeding into the guts of the script.
Thus, the expected code was:
gdb_dir = r"C:\Temp"
gdb_name = "result_gdb.gdb"
gdb_path = r"C:\Temp\result_gdb.gdb"
if arcpy.Exists(gdb_path):
arcpy.Delete_management(gdb_path)
arcpy.CreateFileGDB_management(gdb_dir,gdb_name)
arcpy.CreateFeatureclass_management(gdb_path,"myPolys","POLYGON")
Except that, like the OP, when I step through this in the debugger, right after the "Delete_management" call, I notice that a file directory with the same name as the file geodatabase still exists. Thus, if this non-gdb file directory exists, the Exists() function call returns a <True> value and the code would end up calling the Delete_management function.
I discovered that the following code produces curious (surprising, unexpected) results:
gdb_dir = r"C:\Temp"
gdb_name = "result_gdb.gdb"
gdb_path = r"C:\Temp\result_gdb.gdb"
arcpy.CreateFileGDB_management(gdb_dir,gdb_name)
arcpy.CreateFeatureclass_management(gdb_path,"myPolys","POLYGON")
arcpy.Describe(gdb_path).workspaceType
# returns u'LocalDatabase'
arcpy.Delete_management(gdb_path) # the first call to Delete
arcpy.Exists(gdb_path)
# returns True
arcpy.Describe(gdb_path).workspaceType
# returns u'FileSystem' # the type has changed
arcpy.Delete_management(gdb_path) # the second call to Delete
arcpy.Exists(gdb_path)
# returns False # now it returns false
So, now the python code might have to check just how much the target file geodatabase has been deleted.
I don't want to enable overwriting for the script. I'm not using a 'scratch' workspace. It's not an 'in_memory' usage. I just expect that when I call a function to Delete something that that thing is actually deleted, not just turned into a different type of object.
So, now the code is:
while arcpy.Exists(gdb_path):
arcpy.Delete_management(gdb_path) # just keep calling Delete until it finally goes away