What is the difference between PyPy and Python? are there lot of differences?

Discussion in 'Python' started by ArrC, Jul 13, 2011.

  1. ArrC

    ArrC Guest

    Hey guys,i am a python newbie,
    i just read a qustion on quora where it said that quora quys used pypy (and pylon) to develop quora.

    So, i want to know what are the core diff btw PyPy and Python ?

    And they also talked about the lack of type check in python.

    So, how does it help (strongly typed) in debugging?

    Thanks
    ArrC, Jul 13, 2011
    #1
    1. Advertising

  2. Re: What is the difference between PyPy and Python? are there lot ofdifferences?

    On Thu, Jul 14, 2011 at 12:06 AM, ArrC <> wrote:
    > So, i want to know what are the core diff btw PyPy and Python ?


    Python is a language; PyPy is one implementation of that language. The
    "classic" implementation of Python is CPython, not to be confused with
    Cython; there are a few others as well. If you talk of "installing
    Python", it probably means CPython.

    > And they also talked about the lack of type check in python.
    >
    > So, how does it help (strongly typed) in debugging?


    Sloppy but brief explanation: Python's variables are typeless; its
    objects are strongly typed.

    Longer explanation: Every piece of data in Python is an object.
    Objects can be referenced by names; one object can have more than one
    name pointing to it. Any name can point to any value, which is
    somewhat the opposite of "strongly-typed variables" in other
    languages. For instance:

    a = "Hello" # a points to or "holds" a string
    a = 234 # a now points to an integer
    a = 1.0 # a now points to a float
    a = [1,2,3] # a now has a list (array)

    In debugging, all you generally care about is "what does this object
    point to". I guess whether or not this makes things easier or harder
    depends a lot on what sort of bugs you're tracking down.

    Hope that helps!

    Chris Angelico
    Chris Angelico, Jul 13, 2011
    #2
    1. Advertising

  3. ArrC

    sturlamolden Guest

    On 13 Jul, 16:06, ArrC <> wrote:

    > And they also talked about the lack of type check in python.
    >
    > So, how does it help (strongly typed) in debugging?



    Python is strongly typed. There are no static type checks in Python.
    Type checks are done at runtime. Dynamic typing does not mean that
    Python is a weakly typed language.

    The question of debugging is often raised, particularly by Java heads:

    In Python, the "doctest" and "unittest" modules can be used to verify
    that code works according to specification (e.g. trap type errors),
    and are common alternatives to static type checks.

    http://docs.python.org/release/3.2/library/doctest.html
    http://docs.python.org/release/3.2/library/unittest.html

    It is a good practice to always write tests for your code.

    Python 3.x also has function argument and return value type
    annotations, which is a further guard against type errors:

    http://www.python.org/dev/peps/pep-3107/


    Sturla
    sturlamolden, Jul 13, 2011
    #3
  4. ArrC

    Ian Kelly Guest

    Re: What is the difference between PyPy and Python? are there lot ofdifferences?

    On Wed, Jul 13, 2011 at 8:19 AM, Anthony Kong <> wrote:
    > One of the main difference is that pypy supports only R-Python, which stands
    > for 'Restricted Python".
    > It is a subset of C-python language.


    This is wrong. The PyPy *interpreter* is written in RPython. At the
    application level, PyPy supports the full syntax and semantics of
    Python (with a few minor differences of the same sort that you find in
    Jython or IronPython).
    Ian Kelly, Jul 13, 2011
    #4
  5. ArrC

    Terry Reedy Guest

    Re: What is the difference between PyPy and Python? are there lotof differences?

    On 7/13/2011 10:19 AM, Anthony Kong wrote:
    > One of the main difference is that pypy supports only R-Python, which
    > stands for 'Restricted Python".


    Not true. PyPy is *written* in rpython. It runs standard Python.

    --
    Terry Jan Reedy
    Terry Reedy, Jul 13, 2011
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jakk
    Replies:
    4
    Views:
    12,047
  2. Chris
    Replies:
    0
    Views:
    391
    Chris
    Apr 14, 2004
  3. Home_Job_opportunity
    Replies:
    0
    Views:
    485
    Home_Job_opportunity
    Jan 8, 2009
  4. Home_Job_opportunity
    Replies:
    0
    Views:
    568
    Home_Job_opportunity
    Jan 14, 2009
  5. Merciadri Luca
    Replies:
    5
    Views:
    1,068
    Merciadri Luca
    Oct 14, 2010
Loading...

Share This Page