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


Groups > comp.lang.python > #18426

python philosophical question - strong vs duck typing

Date 2012-01-03 15:13 -0300
Subject python philosophical question - strong vs duck typing
From Sean Wolfe <ether.joe@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4361.1325614408.27778.python-list@python.org> (permalink)

Show all headers | View raw


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

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


Thread

python philosophical question - strong vs duck typing Sean Wolfe <ether.joe@gmail.com> - 2012-01-03 15:13 -0300
  Re: python philosophical question - strong vs duck typing Ben Finney <ben+python@benfinney.id.au> - 2012-01-04 09:28 +1100
    Re: python philosophical question - strong vs duck typing Sean Wolfe <ether.joe@gmail.com> - 2012-01-04 11:30 -0300
    Re: python philosophical question - strong vs duck typing Tim Wintle <tim.wintle@teamrubber.com> - 2012-01-04 17:01 +0000

csiph-web