<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Infinitely nested lists in Python</title>
	<atom:link href="http://asmeurersympy.wordpress.com/2012/09/19/infinitely-nested-lists-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://asmeurersympy.wordpress.com/2012/09/19/infinitely-nested-lists-in-python/</link>
	<description>My blog on my work on SymPy and other fun stuff.</description>
	<lastBuildDate>Sat, 11 May 2013 17:46:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Aaron Meurer</title>
		<link>http://asmeurersympy.wordpress.com/2012/09/19/infinitely-nested-lists-in-python/#comment-669</link>
		<dc:creator><![CDATA[Aaron Meurer]]></dc:creator>
		<pubDate>Wed, 19 Sep 2012 14:53:29 +0000</pubDate>
		<guid isPermaLink="false">http://asmeurersympy.wordpress.com/?p=1160#comment-669</guid>
		<description><![CDATA[Nice. Before it segfaults, it prints a bunch of (.  And it seems that it has been fixed in Python 3 (print(a) gives the same thing as repr(a)).]]></description>
		<content:encoded><![CDATA[<p>Nice. Before it segfaults, it prints a bunch of (.  And it seems that it has been fixed in Python 3 (print(a) gives the same thing as repr(a)).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bradley Froehle</title>
		<link>http://asmeurersympy.wordpress.com/2012/09/19/infinitely-nested-lists-in-python/#comment-667</link>
		<dc:creator><![CDATA[Bradley Froehle]]></dc:creator>
		<pubDate>Wed, 19 Sep 2012 05:38:08 +0000</pubDate>
		<guid isPermaLink="false">http://asmeurersympy.wordpress.com/?p=1160#comment-667</guid>
		<description><![CDATA[You can certainly do it for tuples using the CPython API.  For example:

from ctypes import pythonapi, c_void_p, c_ssize_t, c_int
from _ctypes import PyObj_FromPtr

pythonapi.PyTuple_New.argtypes = (c_ssize_t,)
pythonapi.PyTuple_New.restype = c_void_p
pythonapi.PyTuple_SetItem.argtypes = (c_void_p, c_ssize_t, c_void_p)
pythonapi.PyTuple_SetItem.restype = c_int

a = pythonapi.PyTuple_New(1)
pythonapi.PyTuple_SetItem(a, 0, a)
a = PyObj_FromPtr(a)

assert type(a) is tuple
assert a[0] is a

repr(a) # &#039;((...),)&#039;
print(a) # segfault]]></description>
		<content:encoded><![CDATA[<p>You can certainly do it for tuples using the CPython API.  For example:</p>
<p>from ctypes import pythonapi, c_void_p, c_ssize_t, c_int<br />
from _ctypes import PyObj_FromPtr</p>
<p>pythonapi.PyTuple_New.argtypes = (c_ssize_t,)<br />
pythonapi.PyTuple_New.restype = c_void_p<br />
pythonapi.PyTuple_SetItem.argtypes = (c_void_p, c_ssize_t, c_void_p)<br />
pythonapi.PyTuple_SetItem.restype = c_int</p>
<p>a = pythonapi.PyTuple_New(1)<br />
pythonapi.PyTuple_SetItem(a, 0, a)<br />
a = PyObj_FromPtr(a)</p>
<p>assert type(a) is tuple<br />
assert a[0] is a</p>
<p>repr(a) # &#8216;((&#8230;),)&#8217;<br />
print(a) # segfault</p>
]]></content:encoded>
	</item>
</channel>
</rss>
