Skip to content

Commit

Permalink
Merge pull request #378 from kivy/doc_metaclass
Browse files Browse the repository at this point in the history
Add note about incompatibility of __metaclass__ in Python 3
  • Loading branch information
KeyWeeUsr committed Dec 15, 2018
2 parents 4034c68 + ffe595c commit a28140b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ Reflection classes
Must be set to :class:`MetaJavaClass`, otherwise, all the
methods/fields declared will be not linked to the JavaClass.

.. note::

Make sure to choose the right metaclass specifier. In Python 2
there is ``__metaclass__`` class attribute, in Python 3 there is
a new syntax ``class Stack(JavaClass, metaclass=MetaJavaClass)``.

For more info see `PEP 3115
<https://www.python.org/dev/peps/pep-3115/>`_.

.. attribute:: __javaclass__

Represents the Java class name, in the format 'org/lang/Class' (e.g.
Expand Down

0 comments on commit a28140b

Please sign in to comment.