Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'importing': 0.05; 'subject:code': 0.07; 'sys': 0.07; 'exec': 0.09; 'function,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'try:': 0.09; 'yeah,': 0.09; 'python': 0.11; '"exec"': 0.16; '``exec``': 0.16; 'ah,': 0.16; 'keyword.': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'syntaxerror:': 0.16; 'using,': 0.16; 'topics': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'looks': 0.24; 'switch': 0.26; 'skip:" 20': 0.27; 'header:X-Complaints-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; "doesn't": 0.30; 'statement': 0.30; '>>>>': 0.31; 'accidentally': 0.31; "skip:' 40": 0.31; 'guess': 0.33; 'could': 0.34; 'skip:s 30': 0.35; 'but': 0.35; 'version': 0.36; 'to:addr:python-list': 0.38; 'does': 0.39; '12,': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'is.': 0.60; 'gone': 0.61; "you're": 0.61; "you've": 0.63; 'invalid': 0.68; 'topics.': 0.68; '2015': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: code blocks Date: Mon, 11 May 2015 18:01:12 +0200 Organization: None References: <66312d54-de5a-4015-99b5-41d332559e00@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p57bd9680.dip0.t-ipconnect.de User-Agent: KNode/4.13.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431360083 news.xs4all.nl 2863 [2001:888:2000:d::a6]:43487 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90406 Chris Angelico wrote: > On Tue, May 12, 2015 at 1:22 AM, zipher wrote: >> Ah, yeah, I guess that does it. But (shame) it looks like you've gone >> past the BDFL. Try: >> >>>>> help(exec) >> ^ >> SyntaxError: invalid syntax >> > > That's because, in the version of Python you're using, exec is a > keyword. You could switch to Python 3, where it's a function, or > request it by name. Though interestingly, my Py2 doesn't have any help > on exec: > >>>> help('exec') > no documentation found for 'exec' > > Not sure why that is. Path confusion? You may accidentally be importing Python 3's topics. Try >>> from pydoc_data import topics >>> topics.__file__ '/usr/lib/python2.7/pydoc_data/topics.pyc' >>> "exec" in topics.topics True >>> help("exec") The ``exec`` statement [...] >>> import sys >>> sys.path.insert(0, "/usr/lib/python3.4") >>> del sys.modules["pydoc_data"] >>> del sys.modules["pydoc_data.topics"] >>> help("exec") no documentation found for 'exec'