Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.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; 'thread,': 0.04; 'suppose': 0.05; 'disagree': 0.07; 'subject:based': 0.07; 'type,': 0.07; 'typed': 0.07; 'comparisons': 0.09; 'const': 0.09; 'integer,': 0.09; 'it;': 0.09; 'pointer.': 0.09; 'way;': 0.09; 'weak': 0.09; 'received:209.85.210.174': 0.13; 'received:mail- iy0-f174.google.com': 0.13; 'thanks!': 0.14; 'typing': 0.15; '+1.': 0.16; 'boolean': 0.16; 'compiler,': 0.16; 'disagree.': 0.16; 'driscoll': 0.16; 'foo(int': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'function?': 0.16; 'int.': 0.16; "languages'": 0.16; 'list!': 0.16; 'maybe,': 0.16; 'mean,': 0.16; 'nonzero': 0.16; 'not;': 0.16; 'pointer,': 0.16; 'subject: \n ': 0.16; 'subject:syntax': 0.16; 'thread.': 0.16; 'trimming': 0.16; 'useless.': 0.16; 'value"': 0.16; 'zero,': 0.16; 'syntax': 0.16; 'language': 0.17; 'wrote:': 0.18; 'int': 0.18; 'string,': 0.18; 'that?': 0.18; 'memory': 0.21; 'dec': 0.22; 'header:In-Reply- To:1': 0.22; 'works.': 0.23; 'string': 0.24; "i'm": 0.26; 'expect': 0.26; 'do.': 0.28; 'tend': 0.28; "wasn't": 0.28; 'message-id:@mail.gmail.com': 0.28; 'likes': 0.29; 'pm,': 0.29; 'fairly': 0.30; 'lot.': 0.30; 'sun,': 0.30; 'whitespace': 0.30; '(the': 0.30; 'chris': 0.30; 'quite': 0.32; 'does': 0.32; 'actual': 0.32; 'me?': 0.32; 'pretty': 0.32; 'there': 0.33; 'object': 0.33; 'points': 0.34; 'to:addr:python-list': 0.34; 'normally': 0.34; 'certain': 0.34; 'curious': 0.34; 'integer': 0.34; 'operations': 0.35; 'running': 0.35; 'something': 0.35; 'subject:/': 0.35; 'are:': 0.35; 'url:python': 0.36; 'however,': 0.36; 'post': 0.36; 'beginning': 0.36; 'example,': 0.37; '(to': 0.37; 'archives:': 0.37; 'suddenly': 0.37; 'url:pipermail': 0.37; 'but': 0.37; 'received:google.com': 0.37; "there's": 0.37; 'think': 0.37; 'could': 0.37; 'some': 0.38; 'received:209.85': 0.38; "i'd": 0.39; 'url:org': 0.39; 'strong': 0.39; "it's": 0.40; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'might': 0.40; 'happens': 0.40; 'more': 0.61; 'type': 0.61; '2011': 0.61; 'types': 0.61; 'your': 0.61; 'double': 0.61; 'happen': 0.61; 'provided': 0.62; 'efficient': 0.62; 'leading': 0.62; 'making': 0.67; 'high': 0.67; 'special': 0.68; 'delivered': 0.69; 'become': 0.69; 'care': 0.71; 'stand': 0.72; 'expectations': 0.77; "'1'": 0.84; 'subjective': 0.84; 'this...': 0.84; 'technically': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=iuB3mafzsqOkkAQYmFOcmw6wADEeSotdPNmqVfhlIYw=; b=gQqR87dyX8/0HEZacF02PhWMMK1g0RtjbFmuDLLR8kp18H5JtmBaDvLQs0CvkJth6M hBVhta+BxkXl+NvUIEyKXQ9Pj5OT/1vghKA/mg1CuofPObecYXpVYMmiithD64212xRQ lsXCKoi9ZAycWyJodWOcxX5w92vcLyzhhAVNI= MIME-Version: 1.0 In-Reply-To: <4EED6F64.5020906@wisc.edu> References: <841f4d29-f50b-4b0b-912b-b497fb6e60ec@t16g2000vba.googlegroups.com> <4eed3b00$0$29979$c3e8da3$5496439d@news.astraweb.com> <4EED57E5.2020900@wisc.edu> <4EED6F64.5020906@wisc.edu> Date: Sun, 18 Dec 2011 16:00:46 +1100 Subject: Re: Pythonification of the asterisk-based collection packing/unpacking syntax From: Chris Angelico To: python-list@python.org 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: 60 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1324184448 news.xs4all.nl 6947 [2001:888:2000:d::a6]:37613 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:17435 On Sun, Dec 18, 2011 at 3:43 PM, Evan Driscoll wrote: > On 12/17/2011 21:42, Chris Angelico wrote: >> Welcome to the list! If you're curious as to what's happened, check >> the archives: >> http://mail.python.org/pipermail/python-list/ > Thanks! Incidentally, is there a good way to respond to the original > post in this thread, considering it wasn't delivered to me? I don't know of a way, but this works. It's all part of the same thread. > I mean, suppose '1' were an object and implemented > __lt__. Does it suddenly become not weak typing because of that? Is it weak typing to overload a function? //C++ likes this a lot. int foo(int x,int y) {return x*3+y;} double foo(double x,double y) {return x*3+y;} This is definitely making the term "strongly typed language" fairly useless. > (The other thing is that I think strong vs weak is more subjective than > many of the other measures. Is '1 < True' or '"1"+1' weaker? I think it > has a lot to do with how the operations provided by the language play to > your expectations.) +1. My expectations are: 1) The Boolean value "True" might be the same as a nonzero integer, or might not; it would make sense to use inequality comparisons with zero, MAYBE, but not with 1. So I don't particularly care what the language does with "1 < True", because it's not something that I would normally do. 2) "1"+1, in any high level language with an actual string type, I would expect to produce "11". It makes the most sense this way; having it return 2 means there's a special case where the string happens to look like a number - meaning that " 1"+1 is different from "1"+1. That just feels wrong to me... but I'm fully aware that many other people will disagree. Yep, it's pretty subjective. > On 12/17/2011 22:05, Chris Angelico wrote: >> Not quite; 1 + "one" will be "ne", which might happen to be at memory >> location 2. The data type is going to be char* (or, in a modern >> compiler, const char*), not int. > I'm not quite sure I'd say that it could be 2, exactly, but I definitely > disagree with this... after running 'int x = 5, *p = &x' would you say > that "p is 5"? (Assume &x != 5.) 1+"one" *points to* "ne", but it's > still a pointer. Point. I stand corrected. I tend to think of a char* as "being" the string, even though technically it only points to the beginning of it; it's the nearest thing C has to a string type. (To be honest, it's still a lot better than many high level languages' string types for certain common operations - eg trimming leading whitespace is pretty efficient on a PSZ.) In your example, p would be some integer value that is the pointer, but *p is 5. However, there's really no syntax in C to say what the "string value" is. ChrisA