Github user yu-iskw commented on the pull request:

    https://github.com/apache/spark/pull/8665#issuecomment-138815465
  
    @mengxr unfortunately, a class which inherits from `object` doesn't work. 
And as I commented on 
[SPARK-10276](https://issues.apache.org/jira/browse/SPARK-10276), it doesn't 
work with `@classmethod`.
    
    ```
    # Work
    @since("1.6.0")
    class Foo():
    
    # Not Work
    @since("1.6.0")
    class Foo(object):
    ```
    
    When I tried to add `@since` to a class which inherits from `object`, I got 
an error. It seems that we can't rewrite `__doc__`.
    
    ```
    Traceback (most recent call last):
      File "tmp.py", line 24, in <module>
        class Foo(object):
      File "tmp.py", line 13, in deco
        f.__doc__ = ".. versionadded:: %s" % (version)
    AttributeError: attribute '__doc__' of 'type' objects is not writable
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to