title: loop through dirnames list.remove() is not working
body: <p>I am trying to loop through multiple directories and multiple GDB's to create a list of feature classes. The issue that I am having is that when I try to remove certain feature classes from the list, the script is just being ignored or I get an error that says x does not exist in list.(x). The issue with the feature class names is that it has a 3 letters that are unique to each GDB while still having 2 other components that are standard.</p>
  
  <p>Something like this:</p>
  
  <p>directory1 > directory1.gdb > shapes > fc_dir1_feature</p>
  
  <p>&amp;</p>
  
  <p>directory2 > directory2.gdb > shapes > fc_dir2_feature</p>
  
  <p>and so on...</p>
  
  <p>I am using </p>
  
  <pre><code>for dirpath, dirnames, filenames in arcpy.da.Walk(in_workspace, datatype="FeatureClass",type="Polygon"):
  if "dir1" in dirnames:
      dirnames.remove('dir1')
  </code></pre>
  
  <p>Which works fine to remove the feature datasets from the GDB and by extension all feature classes within. But I cannot remove just specific  feature classes.</p>
  
  <p>Thanks for any help.</p>