File: doc.py

package info (click to toggle)
py-postgresql 1.2.1%2Bgit20180803.ef7b9a9-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,620 kB
  • sloc: python: 18,317; ansic: 2,024; sql: 282; sh: 26; makefile: 22
file content (18 lines) | stat: -rw-r--r-- 377 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
##
# .python.doc
##
"""
Documentation Tools.
"""
from operator import attrgetter

class Doc(object):
	"""
	Simple object that sets the __doc__ attribute to the first parameter and
	initializes __annotations__ using keyword arguments.
	"""
	def __init__(self, doc, **annotations):
		self.__doc__ = str(doc)
		self.__annotations__ = annotations

	__str__ = attrgetter('__doc__')