class NonDataProperty:
    """Much like the property builtin, but only implements __get__,
    making it a non-data property, and can be subsequently reset.

    See http://users.rcn.com/python/download/Descriptor.htm for more
    information.

    >>> class X(object):
    ...   @NonDataProperty
    ...   def foo(self):
    ...     return 3
    >>> x = X()
    >>> x.foo
    3
    >>> x.foo = 4
    >>> x.foo
    4
    >>> X.foo
    <jaraco.classes.properties.NonDataProperty object at ...>
    """

    def __init__(self, fget):
        assert fget is not None, "fget cannot be none"
        assert callable(fget), "fget must be callable"
        self.fget = fget

    def __get__(self, obj, objtype=None):
        if obj is None:
            return self
        return self.fget(obj)


# from http://stackoverflow.com/a/5191224
class ClassPropertyDescriptor:
    def __init__(self, fget, fset=None):
        self.fget = fget
        self.fset = fset

    def __get__(self, obj, klass=None):
        if klass is None:
            klass = type(obj)
        return self.fget.__get__(obj, klass)()

    def __set__(self, obj, value):
        if not self.fset:
            raise AttributeError("can't set attribute")
        type_ = type(obj)
        return self.fset.__get__(obj, type_)(value)

    def setter(self, func):
        if not isinstance(func, (classmethod, staticmethod)):
            func = classmethod(func)
        self.fset = func
        return self


def classproperty(func):
    if not isinstance(func, (classmethod, staticmethod)):
        func = classmethod(func)

    return ClassPropertyDescriptor(func)

@@ -992,64 +992,8 @@
 e):%0A
-        if klass is None:%0A            klass = type(obj)%0A
     
@@ -1048,32 +1048,25 @@
 def 
-__
 set
-__
+ter
 (self, 
-obj, value
+func
 ):%0A 
@@ -1083,352 +1083,703 @@
 not 
-self.fset:%0A            raise AttributeError(%22can't set attribute%22)%0A        type_ = type(obj)%0A        return self.fset.__get__(obj, type_)(value)%0A%0A    def setter(self, func):%0A        if not isinstance(func, (classmethod, staticmethod)
+isinstance(func, (classmethod, staticmethod)):%0A            func = classmethod(func)%0A        self.fset = func%0A        return self%0A%0A%0Adef classproperty(func):%0A    %22%22%22%0A    Like @property but applies at the class level.%0A%0A    %3E%3E%3E class X:%0A    ...   val = None%0A    ...   @classproperty%0A    ...   def foo(cls):%0A    ...     return cls.val%0A    ...   @foo.setter%0A    ...   def foo(cls, val
 ):%0A    
+...
      
-   func = classmethod(func)
+cls.val = val%0A    %3E%3E%3E X.foo%0A    %3E%3E%3E X.foo = 3%0A    %3E%3E%3E X.foo%0A    3%0A    %3E%3E%3E x = X()%0A    %3E%3E%3E x.foo
 %0A    
+3%0A
     
-self.fset = func%0A        return self%0A%0A%0Adef classproperty(func):
+%3E%3E%3E X.foo = 4%0A    %3E%3E%3E x.foo%0A    4%0A%0A    Note, setting a value on an instance does not have the%0A    intended effect.%0A%0A    %3E%3E%3E x.foo = 5%0A    %3E%3E%3E x.foo%0A    5%0A    %3E%3E%3E X.foo  # should be 5%0A    4%0A    %22%22%22
 %0A   

Add some tests for classproperty. Remove unused code (doesn't work as intended).