Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed3.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; 'python,': 0.02; 'operator': 0.03; 'subject:Python': 0.06; 'class,': 0.07; 'problem?': 0.07; 'string': 0.09; 'arrays': 0.09; 'ascii': 0.09; 'classes.': 0.09; 'measure': 0.09; 'pep': 0.09; 'release.': 0.09; 'skip:/ 10': 0.09; 'things,': 0.09; 'python': 0.11; 'language,': 0.12; 'assume': 0.14; 'language.': 0.14; 'random': 0.14; '"+"': 0.16; '1.x': 0.16; '3.0.': 0.16; 'blocks': 0.16; 'boolean': 0.16; 'discussion.': 0.16; 'foot': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'integers,': 0.16; 'less,': 0.16; 'literals': 0.16; 'new-style': 0.16; 'numpy': 0.16; 'old- style': 0.16; 'quoted': 0.16; 'reflects': 0.16; 'right;': 0.16; 'sense,': 0.16; 'subject:Java': 0.16; 'tuple.': 0.16; 'unfair': 0.16; 'unicode,': 0.16; 'which...': 0.16; 'pushed': 0.16; 'language': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'acquired': 0.19; 'normally': 0.19; "python's": 0.19; 'error': 0.23; "aren't": 0.24; 'byte': 0.24; 'library,': 0.24; 'recognize': 0.24; 'unicode': 0.24; 'fine': 0.24; 'versions': 0.24; 'looks': 0.24; "i've": 0.25; '15,': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; 'character': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'went': 0.31; 'that.': 0.31; '(maybe': 0.31; 'shoot': 0.31; 'anyone': 0.31; 'languages': 0.32; 'skip:c 30': 0.32; 'guess': 0.33; 'maybe': 0.34; 'subject: (': 0.35; 'classes': 0.35; 'something': 0.35; 'no,': 0.35; 'usual': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'described': 0.36; 'library.': 0.36; 'transition': 0.36; "didn't": 0.36; "i'll": 0.36; 'similar': 0.36; 'should': 0.36; 'changing': 0.37; 'performance': 0.37; 'handle': 0.38; 'to:addr :python-list': 0.38; 'little': 0.38; 'short': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'according': 0.40; 'major': 0.40; 'how': 0.40; 'days': 0.60; 'even': 0.60; 'hope': 0.61; 'full': 0.61; 'john': 0.61; 'further': 0.61; 'you.': 0.62; "you'll": 0.62; 'today': 0.64; 'pick': 0.64; 'more': 0.64; '(that': 0.65; 'finally': 0.65; 'worth': 0.66; 'here': 0.66; 'between': 0.67; 'nobody': 0.68; 'eyes': 0.78; 'yourself': 0.78; 'glad': 0.83; 'adoption': 0.84; 'cost,': 0.84; 'start.': 0.84; 'widespread': 0.91; 'state.': 0.95; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=skbw6UnvBqFLkD+gCZC6BMQ9GqlVeCM8y3/O4JKaLXU=; b=khqkmtX4ZZ2gEib4NEBS3eARW7h0wFNZf22eMaoyxSLtHlMb2dmB1/7UronBrn1JNQ /ZZBsKn2sOAb0P8P8OUx5Z5zlLJmE0+QRuGssy/+hl9ypQE9tcVX1iWQu6G8pYRVm0xf XHUEcXIm4UdyTExgFSudk9LCM1VhSYwFExHbxJP22VvmR1U40kYb5qAhGG35bhE+egG3 Lv4lSo7hwd9KZDlrMGqcCvmq9iu+K9pb/n2M0hVrnEFutz7CuLeDFibijgdBRKrWEtyO r77DWlp/7zjmTVoJJZrWFcrDdnkZrGa4EXWlQNOOXrIbroQu+0xMA60oduVlP0pC76su OJIg== MIME-Version: 1.0 X-Received: by 10.66.121.234 with SMTP id ln10mr39498270pab.20.1381792313349; Mon, 14 Oct 2013 16:11:53 -0700 (PDT) In-Reply-To: References: Date: Tue, 15 Oct 2013 10:11:53 +1100 Subject: Re: Python was designed (was Re: Multi-threading in Python vs Java) 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.15 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: 65 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381792317 news.xs4all.nl 15914 [2001:888:2000:d::a6]:56811 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56831 On Tue, Oct 15, 2013 at 6:18 AM, John Nagle wrote: > No, Python went through the usual design screwups. > Each of [the below] reflects a design error in the type system which > had to be corrected. I'll pick up each one here as I think some of them need further discussion. > Look at how painful the slow transition to Unicode was, > from just "str" to Unicode strings, ASCII strings, byte strings, byte > arrays, 16 and 31 bit character builds, and finally automatic > switching between rune widths. I'm not sure what you mean by all of these - I've known Python for only a (relatively) short time, wasn't there in the 1.x days (much less the <1.0 days). But according to its history page, the early 1.x versions of Python predate the widespread adoption of Unicode, so it's a little unfair to look with 2013 eyes and say that full true Unicode support should have been there from the start. If anyone invents a language today that doesn't handle Unicode properly, I would be very much disappointed; but changing the meaning of quoted string literals is a pretty major change. I'm just glad it got sorted out for 3.0. As to the 16/32 bit builds, there aren't actually very many languages that get this right; Python's now a blazing torch, showing the way for others to follow. (Pike's had something very similar to PEP 393 for years, but nobody looks to obscurities.) I hope we'll see other languages start to follow suit. > Old-style classes vs. new-style classes. By the time I started using Python, new-style classes existed and were the recommended way to do things, so I never got the "feel" for old-style classes. I assume there was a simplicity to them, since new-style classes were described as having a performance cost, but one worth paying. My guess is it comes under the category of "would have to be omniscient to recognize what would happen"; Steven, maybe you can fill us in? > Adding a > boolean type as an afterthought (that was avoidable; C went through > that painful transition before Python was created). I don't know about that. Some languages get by just fine without dedicated a boolean type. Python didn't have them, then it had them as integers, now it has them as bools. Is it a major problem? (Apart from adding them in a point release. That's an admitted mistake.) Python doesn't have a 'vector' type either, you just use a tuple. Some things don't need to be in the language, they can be pushed off to the standard library. And speaking of which... > Operator "+" as concatenation for built-in arrays but addition > for NumPy arrays. ... NumPy definitely isn't part of the language. It's not even part of the standard library, it's fully third-party. The language decrees that [1,2] + [3,4] = [1,2,3,4], and that custom_object1 + custom_object2 = custom_object1.__add__(custom_object2) more or less, and then leaves the implementation of __add__ up to you. Maybe you'll make an "Entropy" class, where entropy+=int blocks until it's acquired that much more entropy (maybe from /dev/random), and entropy-int returns a random number based on its current state. It makes a measure of sense, if not what you normally would want. You can shoot yourself in the foot in any language; and if you write something as big and popular as NumPy, you get to shoot other people in the foot too! :) ChrisA