Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decorators implementation #1152

Closed
robertwb opened this issue Nov 13, 2010 · 7 comments
Closed

Decorators implementation #1152

robertwb opened this issue Nov 13, 2010 · 7 comments

Comments

@robertwb
Copy link
Contributor

Now decorators are implemented like this:


def foo():
   pass

foo = decorator(foo)
  • first declare function in current scope
  • then decorate it

This is not a big issue now, but when we will support function reassignment take a look at this example:


class Foo(object):
    _x = 0
    @property
    def x(self):
        return self._x
    @x.setter
    def x(self, value):
        self._x = value

# this code will be transformed into this

class Foo(object):
    _x = 0

    def x(self):
        return self._x
    x = property(x)

    def x(self, value):
        self._x = value
    x = x.setter(x)
    # this will raise AttributeError exception
    # as second x() doesn't have setter attribute

At 2010-11-13T17:27:18Z @vitek added attachment testcase.patch

Migrated from http://trac.cython.org/ticket/593

@robertwb
Copy link
Contributor Author

scoder changed milestone from wishlist to 0.14.1
owner from somebody to scoder
status from new to assigned
commented

@robertwb
Copy link
Contributor Author

scoder changed resolution to fixed
status from assigned to closed
commented

Fixed here:

37d6fac

00c7816

@robertwb
Copy link
Contributor Author

scoder changed milestone from 0.14.1 to wishlist
resolution from fixed to empty
status from closed to reopened
commented

Reverted - currently breaks Sage:

https://sage.math.washington.edu:8091/hudson/job/sage-build/453/console

@robertwb
Copy link
Contributor Author

scoder changed owner from scoder to somebody
status from reopened to new
commented

@robertwb
Copy link
Contributor Author

scoder changed owner from somebody to scoder
status from new to assigned
commented

@robertwb
Copy link
Contributor Author

scoder changed milestone from wishlist to 0.15.1
resolution to fixed
status from assigned to closed
commented

Original fix reapplied here:

b309d5d

Sage problem is fixed here:

4c4c867

@robertwb
Copy link
Contributor Author

scoder changed milestone from 0.15.1 to 0.16
commented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant