<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: TypeError: 'NoneType' object is not iterable in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/typeerror-nonetype-object-is-not-iterable/m-p/1032818#M60190</link>
    <description>&lt;LI-CODE lang="python"&gt;if item is not None:
    blah blah
# or
if item:
    blah blah&lt;/LI-CODE&gt;&lt;P&gt;the type is None, you don't test for Nonetype&lt;/P&gt;</description>
    <pubDate>Thu, 04 Mar 2021 12:16:53 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-03-04T12:16:53Z</dc:date>
    <item>
      <title>TypeError: 'NoneType' object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-nonetype-object-is-not-iterable/m-p/1032815#M60189</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I want to search all Features, but exclude those that are a 'NoneType' object&lt;/P&gt;&lt;P&gt;I tried to exclude the&amp;nbsp;'NoneType' object in the search, this is not working??&lt;/P&gt;&lt;P&gt;Appreciate any pointers, to skip the 'NoneType'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;serviceItems = portal.content.search("*",  item_type="Feature*", max_items=4000)
for item in serviceItems:
   if item != 'NoneType':
		   layers = item.layers
		   #print(layers)
			#try:
			for lyr in item.layers:
				print(item.id, item.url, lyr.properties["id"], lyr.properties["name"], item.tags )
				rowitem = (item.id, item.url, lyr.properties["id"], lyr.properties["name"], item.tags)
				filewriter.writerow(rowitem )
	else:
		print("EROR")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 12:10:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-nonetype-object-is-not-iterable/m-p/1032815#M60189</guid>
      <dc:creator>CliveSwan</dc:creator>
      <dc:date>2021-03-04T12:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: 'NoneType' object is not iterable</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-nonetype-object-is-not-iterable/m-p/1032818#M60190</link>
      <description>&lt;LI-CODE lang="python"&gt;if item is not None:
    blah blah
# or
if item:
    blah blah&lt;/LI-CODE&gt;&lt;P&gt;the type is None, you don't test for Nonetype&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 12:16:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-nonetype-object-is-not-iterable/m-p/1032818#M60190</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-04T12:16:53Z</dc:date>
    </item>
  </channel>
</rss>

