Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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; 'subject:Python': 0.05; 'statically': 0.07; 'true)': 0.07; 'type,': 0.07; 'python': 0.09; "'no": 0.09; '22,': 0.09; 'commonly': 0.09; 'if,': 0.09; 'typed': 0.09; 'weak': 0.09; 'stored': 0.10; 'language,': 0.11; 'aug': 0.13; 'language': 0.14; 'subject:Objects': 0.16; 'later': 0.16; 'wed,': 0.16; 'string': 0.17; 'wrote:': 0.17; 'instance,': 0.17; 'restrictions': 0.17; 'typing': 0.17; 'variables': 0.17; 'example': 0.23; 'raise': 0.24; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'rules': 0.27; 'instead.': 0.27; 'strongly': 0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'implicitly': 0.29; 'piece': 0.29; 'e.g.': 0.30; 'says': 0.33; 'to:addr:python- list': 0.33; 'languages': 0.33; 'operations': 0.33; 'themselves': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'something': 0.35; 'but': 0.36; 'does': 0.37; 'being': 0.37; 'received:209': 0.37; 'well.': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'perform': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'treat': 0.65; 'casting': 0.84; 'to:name:python': 0.84; 'kat': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=6TURzkYmiHhCcGZOrK+0wwbZ0QaU8JyvivVkaxM43IM=; b=TB2scehyahL6HeckcP1LE7Si5/arSegvW64VfWFOwI47NSFHB0gQ6jAzhy5qDupfXk j6ZflI45jbgJvw+GXP44naR2jI9xlqyW/h2vCzWrnnw3kW0OH6Zjvz2lpNxzPNPhJ8fC qe1Uf9AvoIqpIRVZZsViqpl8a9xapOPmKrTEosaEzsaZvhx7EJqZ6DnG0V5n6D+utcsX Po8xGTd9FUtpnTSFwMGuCXh/jlDsgbo1MGcd3RvhOxz20w4qL5ObjZVmZOzjlcMTKXr5 RrcWZ4/c8QA98i5FnpzmYkPdR3TPEleF9tNUc65P/Ch28Xuc+xZ+8EnpCsTpelePqqpE SYzw== MIME-Version: 1.0 In-Reply-To: References: <18409992-1e28-4721-8e64-60c69668da4e@googlegroups.com> From: Ian Kelly Date: Wed, 22 Aug 2012 12:15:09 -0600 Subject: Re: Objects in Python To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345659675 news.xs4all.nl 6940 [2001:888:2000:d::a6]:50398 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27667 On Wed, Aug 22, 2012 at 11:46 AM, lipska the kat wrote: > If, in a language, I find I am able to say > > a = 1 > > then later, in the same scope I can say > > a = "foo" > > then later again in the same scope I can say > > a = ([1,2,3], "xyz", True) > > then, and I may be missing something here, to me, that doesn't say 'strongly > typed' that says 'no typing constraints whatsoever' You're conflating "strong typing" with "static typing". Strong typing does not refer to restrictions on what type of data can be stored where, but to restrictions on how operations on that data can be intermixed. The classic example of weak typing is concatenation of strings and numbers, e.g. ("abc" + 123). Weakly typed languages like JavaScript will implicitly coerce the number to a string and perform the concatenation. Strongly typed languages like Python will raise a TypeError instead. Note that statically typed languages can be weakly typed as well. For instance, C is commonly considered to be weakly typed because the casting rules of that language allow you to treat any piece of data as being of any type, even though the variables themselves are all statically typed.