Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82759

what is wrong with d.clear()?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone04.am1.xlned.com!bcyclone04.am1.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <shawool@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.050
X-Spam-Evidence '*H*': 0.90; '*S*': 0.00; 'python3': 0.07; 'sys': 0.07; 'python': 0.11; "'__doc__',": 0.16; 'sys.modules': 0.16; 'advance.': 0.19; '>>>': 0.22; 'import': 0.22; '&gt;&gt;&gt;': 0.24; 'message-id:@mail.gmail.com': 0.30; "skip:' 10": 0.31; '"",': 0.31; 'subject:what': 0.31; 'file': 0.32; '(most': 0.33; 'subject:with': 0.35; 'received:google.com': 0.35; 'thanks': 0.36; 'hi,': 0.36; 'wrong': 0.37; 'skip:& 10': 0.38; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; 'more': 0.64; 'cygwin': 0.84; '2013,': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=DuZy7es1vWcLXSVIwnwpOCyHImmgGSTT28bH3owl/xQ=; b=nH3W2fbp0ETB9qbDxLtd1MvUU0l+Cwp3C2tYwRZd8PKv2KDXENN1HP3lTVyXAQIK3F D6AM7rvQW7gaHKpYMrpMWF13hcWTHXQ1FoSKZwiq8NXSPo3Khag6maOkC576o8ucru7d bWfaJ/7yD/LLxWx0fBcD3nSXWIYshm33isscTaNLGk6YefvtwN49WHkScd0vOwO4tKgC fgQFqYNESNmhAZfumG4bUxmVSko2e4g33FG8ED/vHqMfAmwbnvqmzo3iomTLjFbOLQux YQOgfaIKKI5agIlwaz1T8vcYFh1IhM/n9U9TrhQbRynaUY5cNBFPS8Fgge7RpbNqwUJs TU3g==
MIME-Version 1.0
X-Received by 10.43.154.138 with SMTP id le10mr12985172icc.50.1419146914066; Sat, 20 Dec 2014 23:28:34 -0800 (PST)
Date Sun, 21 Dec 2014 12:58:34 +0530
Subject what is wrong with d.clear()?
From shawool <shawool@gmail.com>
To python-list@python.org
Content-Type multipart/alternative; boundary=001a11c2d3dab27ac7050ab4e388
X-Mailman-Approved-At Mon, 22 Dec 2014 09:16:04 +0100
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17113.1419236165.18130.python-list@python.org> (permalink)
Lines 78
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1419236165 news.xs4all.nl 2891 [2001:888:2000:d::a6]:41362
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 6482
X-Received-Body-CRC 3378519301
Xref csiph.com comp.lang.python:82759

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

where am i going wrong ?

$ python3
Python 3.2.5 (default, Oct  2 2013, 22:58:11)
[GCC 4.8.1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> d = {}
>>> import sys
>>> d = sys.modules
>>> type(d)
<class 'dict'>
>>> dir(d)
['__class__', '__contains__', '__delattr__', '__delitem__', '__doc__',
'__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
'__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__',
'__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
'__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__',
'clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'pop', 'popitem',
'setdefault', 'update', 'values']
>>> d.clear()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
>>> d
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
>>> quit()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>

Thanks in advance.

Best regards,
Shawool

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

what is wrong with d.clear()? shawool <shawool@gmail.com> - 2014-12-21 12:58 +0530
  Re: what is wrong with d.clear()? sohcahtoa82@gmail.com - 2014-12-22 10:15 -0800
    Re: what is wrong with d.clear()? Rick Johnson <rantingrickjohnson@gmail.com> - 2014-12-22 12:54 -0800
      Re: what is wrong with d.clear()? sohcahtoa82@gmail.com - 2014-12-22 13:19 -0800
        Re: what is wrong with d.clear()? Dave Angel <davea@davea.name> - 2014-12-22 16:59 -0500
          Re: what is wrong with d.clear()? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-23 13:33 +1100
            Re: what is wrong with d.clear()? Dave Angel <davea@davea.name> - 2014-12-22 22:18 -0500
            Re: what is wrong with d.clear()? Steve Hayes <hayesstw@telkomsa.net> - 2014-12-23 12:25 +0200
              Re: what is wrong with d.clear()? shawool <shawool@gmail.com> - 2014-12-23 18:29 +0530
                Re: what is wrong with d.clear()? Rustom Mody <rustompmody@gmail.com> - 2014-12-24 04:21 -0800
                Re: what is wrong with d.clear()? shawool <shawool@gmail.com> - 2014-12-24 20:53 +0530
                Re: what is wrong with d.clear()? Rustom Mody <rustompmody@gmail.com> - 2014-12-24 07:51 -0800
                Re: what is wrong with d.clear()? Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-25 21:38 -0700
              Re: what is wrong with d.clear()? Dave Angel <davea@davea.name> - 2014-12-23 15:15 -0500
                Re: what is wrong with d.clear()? alister <alister.nospam.ware@ntlworld.com> - 2014-12-23 21:08 +0000
                Sending plain text messages (was: what is wrong with d.clear()?) Ben Finney <ben+python@benfinney.id.au> - 2014-12-24 08:31 +1100
                Re: Sending plain text messages (was: what is wrong with d.clear()?) alister <alister.nospam.ware@ntlworld.com> - 2014-12-23 22:15 +0000
                Re: Sending plain text messages (was: what is wrong with d.clear()?) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-24 13:23 +1100
                Re: Sending plain text messages (was: what is wrong with d.clear()?) alister <alister.nospam.ware@ntlworld.com> - 2014-12-24 11:42 +0000
                Re: what is wrong with d.clear()? Chris Angelico <rosuav@gmail.com> - 2014-12-24 09:31 +1100
                Re: what is wrong with d.clear()? alister <alister.nospam.ware@ntlworld.com> - 2014-12-23 22:38 +0000
                Re: what is wrong with d.clear()? Chris Angelico <rosuav@gmail.com> - 2014-12-24 09:44 +1100
              Sending plain text messages (was: what is wrong with d.clear()?) Ben Finney <ben+python@benfinney.id.au> - 2014-12-24 08:08 +1100
              [OT]Re: what is wrong with d.clear()? m <mvoicem@gmail.com> - 2015-03-06 00:05 +0100
      Re: what is wrong with d.clear()? Terry Reedy <tjreedy@udel.edu> - 2015-03-05 16:34 -0500
    Re: what is wrong with d.clear()? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-23 13:27 +1100

csiph-web