there is a dataset named "DT" in geodatabase and two featureclasses named "A" and "DT" in the dataset, and My code is:
arcpy.env.workspace=gdb
dts=arcpy.ListDatasets()
for dt in dts:
fcs=arcpy.ListFeatureClasses(feature_dataset=dt)
for fc in fcs:
c=arcpy.GetCount_management(fc)
fis=arcpy.ListFields(fc)
fnames=[f.name for f in fis]
arcpy.AddMessage('{} {} {}'.format(fc,c[0],';'.join(fnames))
After run this code, it'll print the correct name and count for both featureclasses but wrong for 'DT' featureclass's fields, as get the same as 'A' featureclass, not actually 'DT' itself's.
I use 10.8.2.