Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #9172
| Date | 2011-07-10 09:41 -0800 |
|---|---|
| From | Tim Johnson <tim@johnsons-web.com> |
| Subject | Function docstring as a local variable |
| Organization | AkWebsoft |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.842.1310319682.1164.python-list@python.org> (permalink) |
Consider the following:
## code
def test():
"""This is my docstring"""
print(??) ## can I print the docstring above?
## /code
It possible for a function to print it's own docstring?
thanks
(pointers to docs could be sufficient)
--
Tim
tim at johnsons-web dot com or akwebsoft dot com
http://www.akwebsoft.com
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Function docstring as a local variable Tim Johnson <tim@johnsons-web.com> - 2011-07-10 09:41 -0800
Re: Function docstring as a local variable rantingrick <rantingrick@gmail.com> - 2011-07-10 10:44 -0700
Re: Function docstring as a local variable "Colin J. Williams" <cjw@ncf.ca> - 2011-07-10 18:28 -0400
Re: Function docstring as a local variable Ben Finney <ben+python@benfinney.id.au> - 2011-07-11 09:48 +1000
Re: Function docstring as a local variable Corey Richardson <kb1pkl@aim.com> - 2011-07-10 19:00 -0400
Re: Function docstring as a local variable Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-11 11:54 +1000
Re: Function docstring as a local variable alex23 <wuwei23@gmail.com> - 2011-07-10 21:05 -0700
csiph-web