Not the most elegant solution which I have not tested, so hopefully someone has a better suggestion....If you are calling this often in your code, you could create a dictionary of the geodatabase contents, and then run you tests against thatimport arcpy
arcpy.env.workspace = "yourdegeodatabase.sde"
fcDict = {}
#loop through and fill dictionary
dsList = arcpy.ListDatasets()
for ds in dsList:
fcList = arcpy.ListFeatureClasses("*","",ds)
for fc in fcList:
fcDict[fc] = ds
#test
myFC = arcpy.Describe("thefciwanttotest")
if myFC.name in fcDict:
print fcDict[myFC.name]
If it is a once only call in your script for one featureclass, this is a little more streamlined, again not tested.import arcpy
arcpy.env.workspace = "yourdegeodatabase.sde"
myFC = arcpy.Describe("thefciwanttotest")
#loop through
dsList = arcpy.ListDatasets()
for ds in dsList:
fcList = arcpy.ListFeatureClasses(myFC.name,"",ds)
for fc in fcList:
print ds