Skip to content

Commit

Permalink
fix summarysize docstring and some copy edits to CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Sep 7, 2015
1 parent c2d35bb commit 5edd47c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ or
from Julia's root directory. Sometimes errors only show up in one of them, so if you're preparing a pull request it is nice if you've checked both formats before you submit.

Existing docstrings now live primarily in `base/docs/helpdb.jl`.
It is a goal over time to move the docstrings inline to their respective method definition.
If you want to edit the body of a method docstring, you simply then need to run the `doc/genstdlib.jl` script to regenerate the restructured text files **after** you have already rebuilt Julia.
It is a goal over time to move the docstrings inline to their respective method definitions.
If you want to edit the body of a method docstring, run the `doc/genstdlib.jl` script to regenerate the restructured text files **after** you have already rebuilt Julia.
If you want to edit an existing docstring signature, you **first** have to change the signature in the `doc/stdlib` `..function` or `..data` definition (not the auto-generated content) and *then*
edit the helpdb.jl or inline method docstrings. The existing signatures in the `doc/stdlib/*.rst` files are patterned matched to base docstrings and the new content overwrites the content in `doc/stdlib/`.
edit the helpdb.jl or inline method docstrings. The existing signatures in the `doc/stdlib/*.rst` files are pattern matched to base docstrings and the new content overwrites the content in `doc/stdlib/`.
The signature definitions **must** be in sync or else the pattern match will fail and documentation will be lost in the result.
To add entirely new methods to the `stdlib` documentation, first add the signature in the appropriate `rst/stdlib/*.rst` file before writing the docstring, rebuilding Julia, and re-running `doc/genstdlib.jl`.

Expand Down
9 changes: 3 additions & 6 deletions base/interactiveutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,10 @@ whos(pat::Regex) = whos(STDOUT, current_module(), pat)
#################################################################################

"""
Base.summarysize(obj, recurse) -> Int
Base.summarysize(obj; exclude=Union{Module,Function,DataType,TypeName}) -> Int
`summarysize` is an estimate of the size of the object as if all iterables were
allocated inline in general, this forms a conservative lower bound n the memory
"controlled" by the object if recurse is `true`, then simply reachable memory
should also be included, otherwise, only directly used memory should be included
you should never ignore recurse in cases where recursion is possible
Compute the amount of memory used by all unique objects reachable from the argument.
Keyword argument `exclude` specifies a type of objects to exclude from the traversal.
"""
summarysize(obj; exclude = Union{Module,Function,DataType,TypeName}) =
summarysize(obj, ObjectIdDict(), exclude)
Expand Down
4 changes: 2 additions & 2 deletions doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ Getting Around

The memory consumption estimate is an approximate lower bound on the size of the internal structure of the object.

.. function:: Base.summarysize(obj, recurse) -> Int
.. function:: Base.summarysize(obj; exclude=Union{Module,Function,DataType,TypeName}) -> Int

.. Docstring generated from Julia source
``summarysize`` is an estimate of the size of the object as if all iterables were allocated inline in general, this forms a conservative lower bound n the memory "controlled" by the object if recurse is ``true``\ , then simply reachable memory should also be included, otherwise, only directly used memory should be included you should never ignore recurse in cases where recursion is possible
Compute the amount of memory used by all unique objects reachable from the argument. Keyword argument ``exclude`` specifies a type of objects to exclude from the traversal.

.. function:: edit(file::AbstractString, [line])

Expand Down

0 comments on commit 5edd47c

Please sign in to comment.