[PyPy-issue] [issue579] werkzeug securecookie / hmac crashes

Armin Rigo pypy-dev-issue at codespeak.net
Tue Nov 30 12:37:08 CET 2010


Armin Rigo <armin.rigo at gmail.com> added the comment:

Ah, it's an example of people using functions from extension modules and
assuming that they are built-in functions.  The difference shows up when storing
them as class attributes, e.g.:

    class A(object):
        mylen = len
    print A().mylen([2,3,4])

This example works both in PyPy and CPython because len is a built-in function;
however it would not work if we first said:

    _len = len
    def len(lst):
        return _len(lst)

It will be fixed I suppose.

----------
status: unread -> chatting

_______________________________________________________
PyPy development tracker <pypy-dev-issue at codespeak.net>
<https://codespeak.net/issue/pypy-dev/issue579>
_______________________________________________________



More information about the Pypy-issue mailing list