Merge branch 'master' into master

This commit is contained in:
Kodi Arfer 2017-03-09 07:24:07 -08:00 committed by GitHub
commit 05cfe89dd9
2 changed files with 20 additions and 1 deletions

View File

@ -75,4 +75,5 @@
* Sergey Sobko <s.sobko@profitware.ru>
* Philip Xu <pyx@xrefactor.com>
* Charles de Lacombe <ealhad@mail.com>
* Kai Lüke <kailueke@riseup.net>
* John Patterson <john@johnppatterson.com>
* Kai Lüke <kailueke@riseup.net>

View File

@ -476,6 +476,11 @@ like::
Return our copy of x
"""
return self.x
And we might use it like::
bar = FooBar(1)
print bar.get_x()
In Hy:
@ -491,7 +496,20 @@ In Hy:
(defn get-x [self]
"Return our copy of x"
self.x))
And we can use it like:
.. code-block:: clj
(setv bar (FooBar 1))
(print (bar.get-x))
Or using the leading dot syntax!
.. code-block:: clj
(print (.get-x (FooBar 1)))
You can also do class-level attributes. In Python::