Skip to content

Instantly share code, notes, and snippets.

@lstoll
Created March 19, 2012 11:50
Show Gist options
  • Save lstoll/2108967 to your computer and use it in GitHub Desktop.
Save lstoll/2108967 to your computer and use it in GitHub Desktop.
Docstrings
$ clj
Clojure 1.3.0
user=> (defn fun "Docstring" [] ())
#'user/fun
user=> (meta (var fun))
{:arglists ([]), :ns #<Namespace user>, :name fun, :doc "Docstring", :line 4, :file "NO_SOURCE_PATH"}
user=>
$ python
Python 2.7.2 (default, Mar 13 2012, 15:00:06)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def fun():
... """Docstring for fun"""
... pass
...
>>> fun.__doc__
'Docstring for fun'
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment