A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20150714/ad5f8394/attachment.html below:

<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">The docs for PyRun_String say that both globals and locals should be dictionaries [1].<div><br><div>However, digging into the source [2] shows me that locals doesn’t need to be a dictionary;</div><div>it just needs to implement the mapping protocol.  Is it a bad idea to rely on this fact?</div><div><br></div><div>(Context: I’m plugging a custom object into locals that uses __getitem__ to track lookups.)</div></div><div><br></div><div>Thanks,</div><div>Matt</div><div><br></div><div>[1] <a href="https://docs.python.org/2/c-api/veryhigh.html#c.PyRun_StringFlags">https://docs.python.org/3.4/c-api/veryhigh.html#c.PyRun_StringFlags</a></div><div>[2] <a href="https://github.com/python/cpython/blob/master/Objects/frameobject.c#L628-L629">https://github.com/python/cpython/blob/master/Objects/frameobject.c#L628-L629</a></div></body></html>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4