2013-09-29

Condense Python Script with List Manipulations

=====
2013-12-23: FME 2014 supports <null>; a list attribute can also contain <null> elements. But FMEFeature.getAttribute and setAttribute methods do not treat <null> elements as <null>.
We should be aware this point in FME 2014+.
See more information here > Null in FME 2014: Handling Null with Python / Tcl
=====

Python API - fmeobjects.FMEFeature.getAttribute, setAttribute and removeAttribute functions treat list attributes (except nested lists) in the same manner as non-list attributes, as long as list elements are string instances. And also Python language has convenient and powerful mechanisms to manipulate list structures.
Therefore, a script with list manipulations could be condensed using those mechanisms effectively.