Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #67546
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.019 |
| X-Spam-Evidence | '*H*': 0.96; '*S*': 0.00; 'element': 0.07; 'error:': 0.07; 'integers': 0.09; 'thats': 0.09; 'violates': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'assume': 0.14; '[5]': 0.16; 'declaration': 0.16; 'extension,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'integers;': 0.16; 'programmer,': 0.16; 'subject:programming': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'error': 0.23; 'specify': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'restrict': 0.30; 'message-id:@mail.gmail.com': 0.30; 'that.': 0.31; '(since': 0.31; 'languages': 0.32; 'could': 0.34; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'error.': 0.37; 'positive': 0.37; 'application': 0.37; 'list': 0.37; 'skip:[ 10': 0.38; 'does': 0.39; 'how': 0.40; 'above,': 0.60; 'dangerous': 0.60; 'expression': 0.60; 'term': 0.63; 'such': 0.63; 'different': 0.65; 'worth': 0.66; 'mar': 0.68; 'anything.': 0.68; 'to,': 0.72; 'that),': 0.91; 'to:none': 0.92; '***': 0.95 |
| 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:cc :content-type; bh=YuoeUjaqlVjvm+2fPV9RbrK+bOvmEf+V2w17WPNLP3Y=; b=d10vHNTgTJtd2N3tyy6tt9i4eYAZIA5wAa1fCZkplyXpMVPYP14n0hGfsDDSX401NA VQKjv9nOnhgh4ZNt2GyfGa/E4REDhL2umSQ36rTZbbdWDRDqxn6cs/O/ryqD/qhuIE8y 1Ry2scqclwdBmrhqNL74B8lFGnjhpfpV8cOjxIE+oDEAUxOir630zk5Llu7sD5wicmpP G0INBkauOGwTAw8q4cA6QJ5pSuHy0Yz7aAF2S6B1NNXncM0MaPKz0iTf346HlUmN77hP pGw+EQB4fDk0B4ExvH4cPajPq91/J/rbp9A5HPo14cpFVwjQLDje7K32K48pwCUdKTAP qzAw== |
| MIME-Version | 1.0 |
| X-Received | by 10.68.197.36 with SMTP id ir4mr19871566pbc.46.1393855217181; Mon, 03 Mar 2014 06:00:17 -0800 (PST) |
| In-Reply-To | <3b54a279-03a1-4a81-a428-ecad6eb16036@googlegroups.com> |
| References | <B512F079-4F01-4865-BEF3-07DF94F21832@gmail.com> <mailman.7612.1393810048.18130.python-list@python.org> <4c7dbc57-eef9-4582-aecd-aac13a39b45f@googlegroups.com> <mailman.7633.1393849247.18130.python-list@python.org> <3b54a279-03a1-4a81-a428-ecad6eb16036@googlegroups.com> |
| Date | Tue, 4 Mar 2014 01:00:17 +1100 |
| Subject | Re: Functional programming |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| 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.7641.1393855219.18130.python-list@python.org> (permalink) |
| Lines | 29 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1393855219 news.xs4all.nl 2944 [2001:888:2000:d::a6]:58418 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:67546 |
Show key headers only | View raw
On Tue, Mar 4, 2014 at 12:48 AM, Rustom Mody <rustompmody@gmail.com> wrote: > ? [1,2] + [[3,4],[5]] > ERROR: Type error in application > *** expression : [1,2] + [[3,4],[5]] > *** term : [1,2] > *** type : [Int] > *** does not match : [[Int]] > > IOW [1,2,[3,4],[5]] > is a type-wise ill-formed expression just as in python > [[1,2]) > is syntax-wise ill-formed > > Is it worth having such a restriction? > Thats a different argument... How do you know that [1,2] is a list that must contain nothing but integers? By extension, it's also a list that must contain positive integers less than three, so adding [5] violates that. And [] is a list that must contain nothing, ergo it can't be added to, although (since it contains nothing) it can be added to anything. Some languages do let you specify element types (Pike has an "array" type that can hold anything, or you can say "array(int)" to restrict it to integers; you could also say "array(int(1..2))" to specify what I said above, if you actually intend that), but without a declaration from the programmer, it's dangerous to assume there's an error. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Functional programming Ned Batchelder <ned@nedbatchelder.com> - 2014-03-02 20:27 -0500
Re: Functional programming Rustom Mody <rustompmody@gmail.com> - 2014-03-03 03:45 -0800
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-03 23:20 +1100
Re: Functional programming Rustom Mody <rustompmody@gmail.com> - 2014-03-03 05:48 -0800
Re: Functional programming Rustom Mody <rustompmody@gmail.com> - 2014-03-03 05:51 -0800
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-04 01:00 +1100
Re: Functional programming Rustom Mody <rustompmody@gmail.com> - 2014-03-03 06:08 -0800
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-04 01:23 +1100
Re: Functional programming Rustom Mody <rustompmody@gmail.com> - 2014-03-03 06:38 -0800
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-04 02:01 +1100
Re: Functional programming Rustom Mody <rustompmody@gmail.com> - 2014-03-03 07:28 -0800
Re: Functional programming Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-03 17:27 +0000
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-04 05:37 +1100
Re: Functional programming Steven D'Aprano <steve@pearwood.info> - 2014-03-04 05:35 +0000
Re: Functional programming Rustom Mody <rustompmody@gmail.com> - 2014-03-03 21:59 -0800
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-04 17:04 +1100
Re: Functional programming Rustom Mody <rustompmody@gmail.com> - 2014-03-03 22:20 -0800
Re: Functional programming Steven D'Aprano <steve@pearwood.info> - 2014-03-04 08:56 +0000
Re: Functional programming Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-04 11:56 +0100
Re: Functional programming Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-04 11:47 +0000
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-05 00:01 +1100
OT Sine Rule [was Re: Functional programming] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-04 14:25 +0000
Re: OT Sine Rule [was Re: Functional programming] Tim Chase <python.list@tim.thechases.com> - 2014-03-04 08:37 -0600
Re: OT Sine Rule [was Re: Functional programming] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-04 14:42 +0000
Re: OT Sine Rule [was Re: Functional programming] Chris Angelico <rosuav@gmail.com> - 2014-03-05 02:06 +1100
Re: OT Sine Rule [was Re: Functional programming] Tim Chase <python.list@tim.thechases.com> - 2014-03-04 09:21 -0600
Re: Functional programming Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-05 09:59 +0100
Re: Functional programming Marko Rauhamaa <marko@pacujo.net> - 2014-03-04 21:49 +0200
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-05 07:01 +1100
Re: Functional programming Marko Rauhamaa <marko@pacujo.net> - 2014-03-04 22:50 +0200
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-05 08:06 +1100
Re: Functional programming Marko Rauhamaa <marko@pacujo.net> - 2014-03-04 23:21 +0200
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-05 08:26 +1100
Re: Functional programming Marko Rauhamaa <marko@pacujo.net> - 2014-03-04 23:43 +0200
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-05 08:52 +1100
Re: Functional programming Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-05 12:57 +1300
Re: Functional programming Marko Rauhamaa <marko@pacujo.net> - 2014-03-05 02:11 +0200
Re: Functional programming "BartC" <bc@freeuk.com> - 2014-03-04 13:30 +0000
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-05 00:47 +1100
Re: Functional programming Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-04 14:05 +0000
Re: Functional programming Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-04 14:55 +0000
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-05 02:13 +1100
Re: Functional programming MRAB <python@mrabarnett.plus.com> - 2014-03-04 17:07 +0000
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-05 01:17 +1100
Re: Functional programming Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-04 15:18 +0000
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-05 02:28 +1100
Re: Functional programming Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-04 15:45 +0000
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-05 03:04 +1100
Re: Functional programming Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-05 10:09 +0100
Re: Functional programming "BartC" <bc@freeuk.com> - 2014-03-05 11:28 +0000
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-05 23:04 +1100
Re: Functional programming Marko Rauhamaa <marko@pacujo.net> - 2014-03-05 14:11 +0200
Re: Functional programming Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-04 11:06 +1300
Re: Functional programming Ben Finney <ben+python@benfinney.id.au> - 2014-03-04 09:31 +1100
Re: Functional programming Grant Edwards <invalid@invalid.invalid> - 2014-03-04 14:59 +0000
Re: Functional programming Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-04 15:22 +0000
Re: Functional programming Chris Angelico <rosuav@gmail.com> - 2014-03-04 09:42 +1100
Re: Functional programming Ben Finney <ben+python@benfinney.id.au> - 2014-03-04 10:52 +1100
Re: Functional programming "BartC" <bc@freeuk.com> - 2014-03-04 09:41 +0000
Re: Functional programming 88888 Dihedral <dihedral88888@gmail.com> - 2014-03-03 16:35 -0800
csiph-web