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!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.04; 'desired.': 0.07; 'everybody,': 0.07; 'whatever.': 0.07; 'python': 0.08; 'necessary,': 0.09; 'subject:python': 0.10; 'c++': 0.12; 'thanks!': 0.14; 'typing': 0.15; 'abraham': 0.16; 'himself.': 0.16; 'poet': 0.16; 'subject:question': 0.17; 'language': 0.17; 'accepting': 0.19; 'convert': 0.19; 'this?': 0.19; 'seems': 0.20; 'extent': 0.24; 'code': 0.25; "i'm": 0.26; 'variable': 0.28; 'coding': 0.28; 'message-id:@mail.gmail.com': 0.28; 'compile': 0.29; 'theoretical': 0.29; 'closer': 0.30; 'compromise': 0.30; 'types.': 0.30; 'does': 0.32; 'there': 0.33; 'to:addr:python- list': 0.34; 'certain': 0.34; 'anything': 0.34; 'artist': 0.34; 'restrict': 0.34; 'changing': 0.35; 'ourselves': 0.35; 'project': 0.35; 'question': 0.36; 'subject:skip:p 10': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'using': 0.38; 'somewhat': 0.38; 'received:209.85': 0.38; 'option': 0.39; 'being': 0.39; 'strong': 0.39; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'might': 0.40; 'more': 0.61; 'type': 0.61; 'types': 0.61; 'worth': 0.61; 'our': 0.64; 'gain': 0.75; 'peace': 0.76; 'casting': 0.84; 'going?': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=q0zXPKhlrvRT+BwcxJTfyRYHTkb7aTR9SYsmAAASSoc=; b=Omz2i217/hoTIbHv0/AJYvkob1jEpjPWPqSyKRLhUzYqVSiD6GGPojYosnuxi3vA0K P2t2ZlOi8vn91GTBg32ZmOY45yr/yNaYx9WD8Eb8Vi2OI3ixTpZkdoITS3Mc77fPcKY9 WpCfL1KpchrzegWGhF+PY1C2wWyZijZ5TxSFM= MIME-Version: 1.0 Date: Tue, 3 Jan 2012 15:13:26 -0300 Subject: python philosophical question - strong vs duck typing From: Sean Wolfe 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1325614408 news.xs4all.nl 6985 [2001:888:2000:d::a6]:46398 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18426 Hello everybody, I'm a happy pythonista newly subscribed to the group. How is it going? I have a theoretical / philosophical question regarding strong vs duck typing in Python. Let's say we wanted to type strongly in Python and 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++? What I am driving at is, if we are coding in python but looking for more performance, what if we had an option to 1) restrict ourselves somewhat by using strong typing to 2) make it easy to compile or convert down to C++ and thereby gain more performance. It seems to be that accepting the restrictions of strong typing might be worth it in certain circumstances. Basically the option to use a strongly-typed Python as desired. Does this get us closer to being able to convert to Cpp? Does the Cython project have anything to do with this? Thanks! -- A musician must make music, an artist must paint, a poet must write, if he is to be ultimately at peace with himself. - Abraham Maslow