Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: learning python. learning defining functions . need help Date: Fri, 22 Jul 2016 11:35:02 -0400 Lines: 22 Message-ID: References: <432aeb03-ea14-4ece-8e5b-a7521cf12b84@googlegroups.com> <1469201702.1515177.673935617.42048544@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 6PmYofVA8edSbVNtcGdCcQTSNO5PTceyRMvqUooJzP5g== 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; 'defaults': 0.05; 'definitions.': 0.07; 'interpreted': 0.07; 'interpreter.': 0.07; 'subject:help': 0.07; '22,': 0.09; 'dict': 0.09; 'received:internal': 0.09; 'interpreter': 0.15; 'justin': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'spec,': 0.16; 'subject:python.': 0.16; 'wrote:': 0.16; 'instance,': 0.18; 'subject:need': 0.18; 'typing': 0.18; 'why.': 0.18; 'language': 0.19; 'assuming': 0.22; 'header:In-Reply-To:1': 0.24; 'all.': 0.24; "doesn't": 0.26; 'command': 0.26; 'fri,': 0.27; 'subject:learning': 0.29; 'true.': 0.33; 'could': 0.35; 'false': 0.35; 'set.': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'received:66': 0.38; 'anything': 0.38; 'to:addr:python.org': 0.40; 'your': 0.60; 'header:Message-Id:1': 0.61; 'subject:. ': 0.67; 'jul': 0.72; 'dict()': 0.84; 'subject: . ': 0.84; 'walters': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=NXZKP4gZoEiNMN/AqlGuBgBNV1g=; b=jCTz4q R9JZ92/gRRHQzIOpCUIxjpZOYUWg9tG+JFr8e+UzS1kvx+Q6blWDe9murbGgfoeX KOkj8+wojsRqXk3+T+R6rvaIlMfUOWy+GXk2Y0X0rttw9epNTR/V64rj5ZKKQJon n99JSbynTt0DCa98hWGGEb+26oT/Le3d1rwNc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=NXZKP4gZoEiNMN/ AqlGuBgBNV1g=; b=COKyvQ6HrOh4QdDgCzfHFLnXdvMpyV4jNLZkBjREtAR7VyO FigNdPSLrIT0hTk8T5YTDIOQAbwib3hTiRordJPWmGw3QLuYLYHxyxyXicADh8B2 OPcEJRpRG/ckedwIsRPCfsjJ/EVRt7KiFKl2dDtGcygI/4TplKQtvamWrAtk= X-Sasl-Enc: ctpowwNs7PJLEIEtwUL7NbksfWQcD2Se7HfSiGz9mbu/ 1469201702 X-Mailer: MessagingEngine.com Webmail Interface - ajax-2ccfea0a In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <1469201702.1515177.673935617.42048544@webmail.messagingengine.com> X-Mailman-Original-References: <432aeb03-ea14-4ece-8e5b-a7521cf12b84@googlegroups.com> Xref: csiph.com comp.lang.python:111761 On Fri, Jul 22, 2016, at 11:21, justin walters wrote: > Try opening the interactive terminal on your command line and type the > following: > > type({}) == dict() > > That should illustrate why. That doesn't illustrate anything relevant at all. The reason this is false is because dict() is a dict instance, not the dict type. type({}) == dict == type(dict()) will always* be true. >This is because simply typing '{}' could be interpreted as either a >dict or a set. My interpreter defaults 'type({})' to 'dict', but it's >best to not take the risk. This is part of the language spec, it is not something that can be chosen by each interpreter. *well, assuming that "type" and "dict" have not been reassigned from their built-in definitions.