Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18454

Re: python philosophical question - strong vs duck typing

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jeanpierreda@gmail.com>
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.01; 'python.': 0.04; 'cpython': 0.05; 'definitions': 0.07; 'names.': 0.07; 'statically': 0.07; 'terry': 0.07; 'whatever.': 0.07; 'python': 0.08; 'annotations': 0.09; 'executes': 0.09; 'necessary,': 0.09; 'stating': 0.09; 'subject:python': 0.10; 'typing': 0.15; '1:13': 0.16; 'boils': 0.16; 'bytecode': 0.16; 'reedy': 0.16; 'subset': 0.16; 'cc:addr:python-list': 0.16; 'subject:question': 0.17; 'language': 0.17; 'wrote:': 0.18; 'jan': 0.19; 'cc:no real name:2**0': 0.20; "haven't": 0.20; 'header:In-Reply-To:1': 0.22; 'though.': 0.23; 'cc:2**0': 0.24; 'extent': 0.24; 'static': 0.24; 'compiled': 0.25; 'code': 0.25; 'guess': 0.26; 'code.': 0.26; 'variable': 0.28; 'url:mailman': 0.28; 'message- id:@mail.gmail.com': 0.28; 'compile': 0.29; 'explicitly': 0.29; 'sean': 0.29; 'theoretical': 0.29; 'problem': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'definition': 0.30; 'fairly': 0.30; 'seem': 0.30; 'closer': 0.30; 'compiling': 0.30; 'compromise': 0.30; 'confused': 0.30; 'received:209.85.210.46': 0.30; 'received:mail-pz0-f46.google.com': 0.30; 'types.': 0.30; 'yes.': 0.30; 'usually': 0.31; 'objects': 0.32; 'tue,': 0.32; 'url:listinfo': 0.32; "can't": 0.32; 'actually': 0.33; 'there': 0.33; 'creates': 0.34; 'right,': 0.34; 'changing': 0.35; 'something': 0.35; 'project': 0.35; 'url:python': 0.36; 'similar': 0.36; 'question': 0.36; 'subject:skip:p 10': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'think': 0.37; 'hold': 0.38; 'received:209.85': 0.38; 'option': 0.39; 'url:org': 0.39; 'being': 0.39; 'else': 0.39; 'strong': 0.39; 'received:209': 0.40; 'type': 0.61; 'types': 0.61; 'our': 0.64; 'making': 0.67; '2012': 0.67; 'casting': 0.84; 'compiles': 0.84; 'preclude': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=VzMKybVwR/OsBJ3PjVSLPY9kMoz6kfbjp8OsghHTN/s=; b=laAQAWew9ybKkEIAOj7FtQ3SKR2DqntniYuf0RGLFQB83hKtAbNdoQUVU7Qx0pcy3E dY8Zh3L6hpcMElxRedMajxjDDgkJiFEirqkge33w9KKeErEah6ddITdDdFBOAWBldu6Q Vsc9PqsL5rHcdpD1nqWPc1Bvh2BxRSH4oah30=
MIME-Version 1.0
In-Reply-To <jdvovs$iri$1@dough.gmane.org>
References <CAOFf2a0dG1tR1-2sJnqCCGqVXocqvzGScGeDJXeXwKdfdvuT-Q@mail.gmail.com> <jdvovs$iri$1@dough.gmane.org>
From Devin Jeanpierre <jeanpierreda@gmail.com>
Date Tue, 3 Jan 2012 16:06:24 -0500
Subject Re: python philosophical question - strong vs duck typing
To Terry Reedy <tjreedy@udel.edu>
Content-Type text/plain; charset=UTF-8
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4387.1325624829.27778.python-list@python.org> (permalink)
Lines 54
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1325624829 news.xs4all.nl 6932 [2001:888:2000:d::a6]:49685
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18454

Show key headers only | View raw


> Python objects are strongly typed, in any sensible meaning of the term.

There are people that hold definitions of strong typing that preclude
Python. Those people think their definition is reasonable, but at the
same time haven't confused static typing with strong typing. I guess
the problem is that this boils down to opinion, but you're stating it
as incontrovertible fact.

> What you mean is statically or explicitly typing names.

Right, yes.

> Cython compiles Python as is to C. It also gives the option to add type
> annotations to names to get faster code. Shredskin compiles a subset of
> Python, or a subset of usages, to C, with similar benefits.

I seem to remember there being a project which compiled the Python
bytecode down to C in a very dumb way (basically just making C code
that creates the bytecode and executes it in the CPython VM). I can't
find it, though.

Anyway, compiling Python to C is actually fairly trivial. People
usually mean something else by it, though.

-- Devin

On Tue, Jan 3, 2012 at 3:38 PM, Terry Reedy <tjreedy@udel.edu> wrote:
> On 1/3/2012 1:13 PM, Sean Wolfe wrote:
>
>> I have a theoretical / philosophical question regarding strong vs duck
>> typing in Python. Let's say we wanted to type strongly in Python and
>
>
> Python objects are strongly typed, in any sensible meaning of the term.
> What you mean is statically or explicitly typing names.
>
>
>> were willing to compromise our code to the extent necessary, eg not
>> changing variable types or casting or whatever. Let's say there was a
>> methodology in Python to declare variable types.
>>
>> The question is, given this possibility, would this get us closer to
>> being able to compile down to a language like C or C++?
>
>
> Cython compiles Python as is to C. It also gives the option to add type
> annotations to names to get faster code. Shredskin compiles a subset of
> Python, or a subset of usages, to C, with similar benefits.
>
> --
> Terry Jan Reedy
>
> --
> http://mail.python.org/mailman/listinfo/python-list

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: python philosophical question - strong vs duck typing Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-03 16:06 -0500

csiph-web