cs-deco 20240326__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ include README.md
@@ -0,0 +1,717 @@
1
+ Metadata-Version: 2.1
2
+ Name: cs.deco
3
+ Version: 20240326
4
+ Summary: Assorted function decorators.
5
+ Author-email: Cameron Simpson <cs@cskk.id.au>
6
+ License: GNU General Public License v3 or later (GPLv3+)
7
+ Project-URL: URL, https://bitbucket.org/cameron_simpson/css/commits/all
8
+ Keywords: python2,python3
9
+ Platform: UNKNOWN
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
17
+ Description-Content-Type: text/markdown
18
+
19
+ Assorted function decorators.
20
+
21
+ *Latest release 20240326*:
22
+ default_params: update wrapper signature to mark the defaulted params as optional.
23
+
24
+ ## Function `ALL(func)`
25
+
26
+ Include this function's name in its module's `__all__` list.
27
+
28
+ Example:
29
+
30
+ from cs.deco import ALL
31
+
32
+ __all__ = []
33
+
34
+ def obscure_function(...):
35
+ ...
36
+
37
+ @ALL
38
+ def well_known_function(...):
39
+ ...
40
+
41
+ ## Function `cached(*a, **kw)`
42
+
43
+ Former name for @cachedmethod.
44
+
45
+ ## Function `cachedmethod(*da, **dkw)`
46
+
47
+ Decorator to cache the result of an instance or class method
48
+ and keep a revision counter for changes.
49
+
50
+ The cached values are stored on the instance (`self`).
51
+ The revision counter supports the `@revised` decorator.
52
+
53
+ This decorator may be used in 2 modes.
54
+ Directly:
55
+
56
+ @cachedmethod
57
+ def method(self, ...)
58
+
59
+ or indirectly:
60
+
61
+ @cachedmethod(poll_delay=0.25)
62
+ def method(self, ...)
63
+
64
+ Optional keyword arguments:
65
+ * `attr_name`: the basis name for the supporting attributes.
66
+ Default: the name of the method.
67
+ * `poll_delay`: minimum time between polls; after the first
68
+ access, subsequent accesses before the `poll_delay` has elapsed
69
+ will return the cached value.
70
+ Default: `None`, meaning the value never becomes stale.
71
+ * `sig_func`: a signature function, which should be significantly
72
+ cheaper than the method. If the signature is unchanged, the
73
+ cached value will be returned. The signature function
74
+ expects the instance (`self`) as its first parameter.
75
+ Default: `None`, meaning no signature function;
76
+ the first computed value will be kept and never updated.
77
+ * `unset_value`: the value to return before the method has been
78
+ called successfully.
79
+ Default: `None`.
80
+
81
+ If the method raises an exception, this will be logged and
82
+ the method will return the previously cached value,
83
+ unless there is not yet a cached value
84
+ in which case the exception will be reraised.
85
+
86
+ If the signature function raises an exception
87
+ then a log message is issued and the signature is considered unchanged.
88
+
89
+ An example use of this decorator might be to keep a "live"
90
+ configuration data structure, parsed from a configuration
91
+ file which might be modified after the program starts. One
92
+ might provide a signature function which called `os.stat()` on
93
+ the file to check for changes before invoking a full read and
94
+ parse of the file.
95
+
96
+ *Note*: use of this decorator requires the `cs.pfx` module.
97
+
98
+ ## Function `contextdecorator(*da, **dkw)`
99
+
100
+ A decorator for a context manager function `cmgrfunc`
101
+ which turns it into a decorator for other functions.
102
+
103
+ This supports easy implementation of "setup" and "teardown"
104
+ code around other functions without the tedium of defining
105
+ the wrapper function itself. See the examples below.
106
+
107
+ The resulting context manager accepts an optional keyword
108
+ parameter `provide_context`, default `False`. If true, the
109
+ context returned from the context manager is provided as the
110
+ first argument to the call to the wrapped function.
111
+
112
+ Note that the context manager function `cmgrfunc`
113
+ has _not_ yet been wrapped with `@contextmanager`,
114
+ that is done by `@contextdecorator`.
115
+
116
+ This decorator supports both normal functions and generator functions.
117
+
118
+ With a normal function the process is:
119
+ * call the context manager with `(func,a,kw,*da,**dkw)`,
120
+ returning `ctxt`,
121
+ where `da` and `dkw` are the positional and keyword parameters
122
+ supplied when the decorator was defined.
123
+ * within the context
124
+ return the value of `func(ctxt,*a,**kw)` if `provide_context` is true
125
+ or the value of `func(*a,**kw)` if not (the default)
126
+
127
+ With a generator function the process is:
128
+ * obtain an iterator by calling `func(*a,**kw)`
129
+ * for iterate over the iterator, yielding its results,
130
+ by calling the context manager with `(func,a,kw,**da,**dkw)`,
131
+ around each `next()`
132
+ Note that it is an error to provide a true value for `provide_context`
133
+ if the decorated function is a generator function.
134
+
135
+ Some examples follow.
136
+
137
+ Trace the call and return of a specific function:
138
+
139
+ @contextdecorator
140
+ def tracecall(func, a, kw):
141
+ """ Trace the call and return from some function.
142
+ This can easily be adapted to purposes such as timing a
143
+ function call or logging use.
144
+ """
145
+ print("call %s(*%r,**%r)" % (func, a, kw))
146
+ try:
147
+ yield
148
+ except Exception as e:
149
+ print("exception from %s(*%r,**%r): %s" % (func, a, kw, e))
150
+ raise
151
+ else:
152
+ print("return from %s(*%r,**%r)" % (func, a, kw))
153
+
154
+ @tracecall
155
+ def f():
156
+ """ Some function to trace.
157
+ """
158
+
159
+ @tracecall(provide_context=True):
160
+ def f(ctxt, *a, **kw):
161
+ """ A function expecting the context object as its first argument,
162
+ ahead of whatever other arguments it would normally require.
163
+ """
164
+
165
+ See who is making use of a generator's values,
166
+ when a generator might be invoked in one place and consumed elsewhere:
167
+
168
+ from cs.py.stack import caller
169
+
170
+ @contextdecorator
171
+ def genuser(genfunc, *a, **kw):
172
+ user = caller(-4)
173
+ print(f"iterate over {genfunc}(*{a!r},**{kw!r}) from {user}")
174
+ yield
175
+
176
+ @genuser
177
+ def linesof(filename):
178
+ with open(filename) as f:
179
+ yield from f
180
+
181
+ # obtain a generator of lines here
182
+ lines = linesof(__file__)
183
+
184
+ # perhaps much later, or in another function
185
+ for lineno, line in enumerate(lines, 1):
186
+ print("line %d: %d words" % (lineno, len(line.split())))
187
+
188
+ Turn on "verbose mode" around a particular function:
189
+
190
+ import sys
191
+ import threading
192
+ from cs.context import stackattrs
193
+
194
+ class State(threading.local):
195
+ def __init__(self):
196
+ # verbose if stderr is on a terminal
197
+ self.verbose = sys.stderr.isatty()
198
+
199
+ # per thread global state
200
+ state = State()
201
+
202
+ @contextdecorator
203
+ def verbose(func):
204
+ with stackattrs(state, verbose=True) as old_attrs:
205
+ if not old_attrs['verbose']:
206
+ print(f"enabled verbose={state.verbose} for function {func}")
207
+ # yield the previous verbosity as the context
208
+ yield old_attrs['verbose']
209
+
210
+ # turn on verbose mode
211
+ @verbose
212
+ def func(x, y):
213
+ if state.verbose:
214
+ # print if verbose
215
+ print("x =", x, "y =", y)
216
+
217
+ # turn on verbose mode and also pass in the previous state
218
+ # as the first argument
219
+ @verbose(provide_context=True):
220
+ def func2(old_verbose, x, y):
221
+ if state.verbose:
222
+ # print if verbose
223
+ print("old_verbosity =", old_verbose, "x =", x, "y =", y)
224
+
225
+ ## Function `contextual(func)`
226
+
227
+ Wrap a simple function as a context manager.
228
+
229
+ This was written to support users of `@strable`,
230
+ which requires its `open_func` to return a context manager;
231
+ this turns an arbitrary function into a context manager.
232
+
233
+ Example promoting a trivial function:
234
+
235
+ >>> f = lambda: 3
236
+ >>> cf = contextual(f)
237
+ >>> with cf() as x: print(x)
238
+ 3
239
+
240
+ ## Function `decorator(deco)`
241
+
242
+ Wrapper for decorator functions to support optional arguments.
243
+
244
+ The actual decorator function ends up being called as:
245
+
246
+ mydeco(func, *da, **dkw)
247
+
248
+ allowing `da` and `dkw` to affect the behaviour of the decorator `mydeco`.
249
+
250
+ Examples:
251
+
252
+ # define your decorator as if always called with func and args
253
+ @decorator
254
+ def mydeco(func, *da, arg2=None):
255
+ ... decorate func subject to the values of da and arg2
256
+
257
+ # mydeco called with defaults
258
+ @mydeco
259
+ def func1(...):
260
+ ...
261
+
262
+ @ mydeco called with nondefault arguments
263
+ @mydeco('foo', arg2='bah')
264
+ def func2(...):
265
+ ...
266
+
267
+ ## Function `default_params(*da, **dkw)`
268
+
269
+ Decorator to provide factory functions for default parameters.
270
+
271
+ This decorator accepts the following keyword parameters:
272
+ * `_strict`: default `False`; if true only replace genuinely
273
+ missing parameters; if false also replace the traditional
274
+ `None` placeholder value
275
+ The remaining keyword parameters are factory functions
276
+ providing the respective default values.
277
+
278
+ Atypical one off direct use:
279
+
280
+ @default_params(dbconn=open_default_dbconn,debug=lambda: settings.DB_DEBUG_MODE)
281
+ def dbquery(query, *, dbconn):
282
+ dbconn.query(query)
283
+
284
+ Typical use as a decorator factory:
285
+
286
+ # in your support module
287
+ uses_ds3 = default_params(ds3client=get_ds3client)
288
+
289
+ # calling code which needs a ds3client
290
+ @uses_ds3
291
+ def do_something(.., *, ds3client,...):
292
+ ... make queries using ds3client ...
293
+
294
+ This replaces the standard boilerplate and avoids replicating
295
+ knowledge of the default factory as exhibited in this legacy code:
296
+
297
+ def do_something(.., *, ds3client=None,...):
298
+ if ds3client is None:
299
+ ds3client = get_ds3client()
300
+ ... make queries using ds3client ...
301
+
302
+ ## Function `fmtdoc(func)`
303
+
304
+ Decorator to replace a function's docstring with that string
305
+ formatted against the function's module `__dict__`.
306
+
307
+ This supports simple formatted docstrings:
308
+
309
+ ENVVAR_NAME = 'FUNC_DEFAULT'
310
+
311
+ @fmtdoc
312
+ def func():
313
+ """Do something with os.environ[{ENVVAR_NAME}]."""
314
+ print(os.environ[ENVVAR_NAME])
315
+
316
+ This gives `func` this docstring:
317
+
318
+ Do something with os.environ[FUNC_DEFAULT].
319
+
320
+ *Warning*: this decorator is intended for wiring "constants"
321
+ into docstrings, not for dynamic values. Use for other types
322
+ of values should be considered with trepidation.
323
+
324
+ ## Function `logging_wrapper(*da, **dkw)`
325
+
326
+ Decorator for logging call shims
327
+ which bumps the `stacklevel` keyword argument so that the logging system
328
+ chooses the correct frame to cite in messages.
329
+
330
+ Note: has no effect on Python < 3.8 because `stacklevel` only
331
+ appeared in that version.
332
+
333
+ ## Function `observable_class(property_names, only_unequal=False)`
334
+
335
+ Class decorator to make various instance attributes observable.
336
+
337
+ Parameters:
338
+ * `property_names`:
339
+ an interable of instance property names to set up as
340
+ observable properties. As a special case a single `str` can
341
+ be supplied if only one attribute is to be observed.
342
+ * `only_unequal`:
343
+ only call the observers if the new property value is not
344
+ equal to the previous proerty value. This requires property
345
+ values to be comparable for inequality.
346
+ Default: `False`, meaning that all updates will be reported.
347
+
348
+ ## Function `OBSOLETE(*da, **dkw)`
349
+
350
+ Decorator for obsolete functions.
351
+
352
+ Use:
353
+
354
+ @OBSOLETE
355
+ def func(...):
356
+
357
+ or
358
+
359
+ @OBSOLETE("new_func_name")
360
+ def func(...):
361
+
362
+ This emits a warning log message before calling the decorated function.
363
+ Only one warning is emitted per calling location.
364
+
365
+ ## Class `Promotable`
366
+
367
+ A mixin class which supports the `@promote` decorator.
368
+
369
+ *Method `Promotable.promote(obj)`*:
370
+ Promote `obj` to an instance of `cls` or raise `TypeError`.
371
+ This method supports the `@promote` decorator.
372
+
373
+ This base method will call the `from_`*typename*`(obj)` class factory
374
+ method if present, where *typename* is `obj.__class__.__name__`.
375
+
376
+ Subclasses may override this method to promote other types,
377
+ typically:
378
+
379
+ @classmethod
380
+ def promote(cls, obj):
381
+ if isinstance(obj, cls):
382
+ return obj
383
+ ... various specific type promotions
384
+ ... not done via a from_typename factory method
385
+ # fall back to Promotable.promote
386
+ return super().promote(obj)
387
+
388
+ ## Function `promote(*da, **dkw)`
389
+
390
+ A decorator to promote argument values automatically in annotated functions.
391
+
392
+ If the annotation is `Optional[some_type]` or `Union[some_type,None]`
393
+ then the promotion will be to `some_type` but a value of `None`
394
+ will be passed through unchanged.
395
+
396
+ The decorator accepts optional parameters:
397
+ * `params`: if supplied, only parameters in this list will
398
+ be promoted
399
+ * `types`: if supplied, only types in this list will be
400
+ considered for promotion
401
+
402
+ For any parameter with a type annotation, if that type has a
403
+ `.promote(value)` class method and the function is called with a
404
+ value not of the type of the annotation, the `.promote` method
405
+ will be called to promote the value to the expected type.
406
+
407
+ Note that the `Promotable` mixin provides a `.promote()`
408
+ method which promotes `obj` to the class if the class has a
409
+ factory class method `from_`*typename*`(obj)` where *typename*
410
+ is `obj.__class__.__name__`.
411
+ A common case for me is lexical objects which have a `from_str(str)`
412
+ factory to produce an instance from its textual form.
413
+
414
+ Additionally, if the `.promote(value)` class method raises a `TypeError`
415
+ and `value` has a `.as_`*typename* attribute
416
+ (where *typename* is the name of the type annotation),
417
+ if that attribute is an instance method of `value`
418
+ then promotion will be attempted by calling `value.as_`*typename*`()`
419
+ otherwise the attribute will be used directly
420
+ on the presumption that it is a property.
421
+
422
+ A typical `promote(cls, obj)` method looks like this:
423
+
424
+ @classmethod
425
+ def promote(cls, obj):
426
+ if isinstance(obj, cls):
427
+ return obj
428
+ ... recognise various types ...
429
+ ... and return a suitable instance of cls ...
430
+ raise TypeError(
431
+ "%s.promote: cannot promote %s:%r",
432
+ cls.__name__, obj.__class__.__name__, obj)
433
+
434
+ Example:
435
+
436
+ >>> from cs.timeseries import Epoch
437
+ >>> from typeguard import typechecked
438
+ >>>
439
+ >>> @promote
440
+ ... @typechecked
441
+ ... def f(data, epoch:Epoch=None):
442
+ ... print("epoch =", type(epoch), epoch)
443
+ ...
444
+ >>> f([1,2,3], epoch=12.0)
445
+ epoch = <class 'cs.timeseries.Epoch'> Epoch(start=0, step=12)
446
+
447
+ Example using a class with an `as_P` instance method:
448
+
449
+ >>> class P:
450
+ ... def __init__(self, x):
451
+ ... self.x = x
452
+ ... @classmethod
453
+ ... def promote(cls, obj):
454
+ ... raise TypeError("dummy promote method")
455
+ ...
456
+ >>> class C:
457
+ ... def __init__(self, n):
458
+ ... self.n = n
459
+ ... def as_P(self):
460
+ ... return P(self.n + 1)
461
+ ...
462
+ >>> @promote
463
+ ... def p(p: P):
464
+ ... print("P =", type(p), p.x)
465
+ ...
466
+ >>> c = C(1)
467
+ >>> p(c)
468
+ P = <class 'cs.deco.P'> 2
469
+
470
+ *Note*: one issue with this is due to the conflict in name
471
+ between this decorator and the method it looks for in a class.
472
+ The `promote` _method_ must appear after any methods in the
473
+ class which are decorated with `@promote`, otherwise the
474
+ `promote` method supplants the name `promote` making it
475
+ unavailable as the decorator.
476
+ I usually just make `.promote` the last method.
477
+
478
+ Failing example:
479
+
480
+ class Foo:
481
+ @classmethod
482
+ def promote(cls, obj):
483
+ ... return promoted obj ...
484
+ @promote
485
+ def method(self, param:Type, ...):
486
+ ...
487
+
488
+ Working example:
489
+
490
+ class Foo:
491
+ @promote
492
+ def method(self, param:Type, ...):
493
+ ...
494
+ # promote method as the final method of the class
495
+ @classmethod
496
+ def promote(cls, obj):
497
+ ... return promoted obj ...
498
+
499
+ ## Function `strable(*da, **dkw)`
500
+
501
+ Decorator for functions which may accept a `str`
502
+ instead of their core type.
503
+
504
+ Parameters:
505
+ * `func`: the function to decorate
506
+ * `open_func`: the "open" factory to produce the core type
507
+ if a string is provided;
508
+ the default is the builtin "open" function.
509
+ The returned value should be a context manager.
510
+ Simpler functions can be decorated with `@contextual`
511
+ to turn them into context managers if need be.
512
+
513
+ The usual (and default) example is a function to process an
514
+ open file, designed to be handed a file object but which may
515
+ be called with a filename. If the first argument is a `str`
516
+ then that file is opened and the function called with the
517
+ open file.
518
+
519
+ Examples:
520
+
521
+ @strable
522
+ def count_lines(f):
523
+ return len(line for line in f)
524
+
525
+ class Recording:
526
+ "Class representing a video recording."
527
+ ...
528
+ @strable(open_func=Recording)
529
+ def process_video(r):
530
+ ... do stuff with `r` as a Recording instance ...
531
+
532
+ *Note*: use of this decorator requires the `cs.pfx` module.
533
+
534
+ # Release Log
535
+
536
+
537
+
538
+ *Release 20240326*:
539
+ default_params: update wrapper signature to mark the defaulted params as optional.
540
+
541
+ *Release 20240316*:
542
+ Fixed release upload artifacts.
543
+
544
+ *Release 20240314.1*:
545
+ New release with corrected install path.
546
+
547
+ *Release 20240314*:
548
+ Tiny doc update.
549
+
550
+ *Release 20240303*:
551
+ Promotable.promote: do not just handle str, handle anything with a from_*typename* factory method.
552
+
553
+ *Release 20240211*:
554
+ Promotable: no longer abstract, provide a default promote() method which tries cls.from_str for str.
555
+
556
+ *Release 20231129*:
557
+ @cachedmethod: ghastly hack for the revision attribute to accomodate objects which return None for missing attributes.
558
+
559
+ *Release 20230331*:
560
+ @promote: pass None through for Optional parameters.
561
+
562
+ *Release 20230212*:
563
+ New Promotable abstract class mixin, which requires the creation of a .promote(cls,obj)->cls class method.
564
+
565
+ *Release 20230210*:
566
+ @promote: add support for .as_TypeName() instance method on the source object or a .as_TypeName property/attribut.
567
+
568
+ *Release 20221214*:
569
+ @decorator: use functools.update_wrapper to propagate the decorated function's attributes to the wrapper (still legacy code for Python prior to 3.2).
570
+
571
+ *Release 20221207*:
572
+ Small updates.
573
+
574
+ *Release 20221106.1*:
575
+ @promote: support Optional[sometype] parameters.
576
+
577
+ *Release 20221106*:
578
+ New @promote decorator to autopromote parameter values according to their type annotation.
579
+
580
+ *Release 20220918.1*:
581
+ @default_param: append parameter descriptions to the docstring of the decorated function, bugfix __name__ setting.
582
+
583
+ *Release 20220918*:
584
+ * @OBSOLETE: tweak message format.
585
+ * @default_params: docstring: simplify the example and improve the explaination.
586
+ * @default_params: set the __name__ of the wrapper function.
587
+
588
+ *Release 20220905*:
589
+ * New @ALL decorator to include a function in __all__.
590
+ * New @default_params decorator for making decorators which provide default argument values from callables.
591
+
592
+ *Release 20220805*:
593
+ @OBSOLETE: small improvements.
594
+
595
+ *Release 20220327*:
596
+ Some fixes for @cachedmethod.
597
+
598
+ *Release 20220311*:
599
+ @cachedmethod: change the meaning of poll_delay=None to mean "never goes stale" as I had thought it already did.
600
+
601
+ *Release 20220227*:
602
+ @cachedmethod: more paranoid access to the revision attribute.
603
+
604
+ *Release 20210823*:
605
+ @decorator: preserve the __name__ of the wrapped function.
606
+
607
+ *Release 20210123*:
608
+ Syntax backport for older Pythons.
609
+
610
+ *Release 20201202*:
611
+ @decorator: tweak test for callable(da[0]) to accord with the docstring.
612
+
613
+ *Release 20201025*:
614
+ New @contextdecorator decorator for context managers to turn them into setup/teardown decorators.
615
+
616
+ *Release 20201020*:
617
+ * @cachedmethod: bugfix cache logic.
618
+ * @strable: support generator functions.
619
+
620
+ *Release 20200725*:
621
+ Overdue upgrade of @decorator to support combining the function and decorator args in one call.
622
+
623
+ *Release 20200517.2*:
624
+ Minor upgrade to @OBSOLETE.
625
+
626
+ *Release 20200517.1*:
627
+ Tweak @OBSOLETE and @cached (obsolete name for @cachedmethod).
628
+
629
+ *Release 20200517*:
630
+ Get warning() from cs.gimmicks.
631
+
632
+ *Release 20200417*:
633
+ * @decorator: do not override __doc__ on the decorated function, just provide default.
634
+ * New @logging_wrapper which bumps the `stacklevel` parameter in Python 3.8 and above so that shims recite the correct caller.
635
+
636
+ *Release 20200318.1*:
637
+ New @OBSOLETE to issue a warning on a call to an obsolete function, like an improved @cs.logutils.OBSOLETE (which needs to retire).
638
+
639
+ *Release 20200318*:
640
+ @cachedmethod: tighten up the "is the value changed" try/except.
641
+
642
+ *Release 20191012*:
643
+ * New @contextual decorator to turn a simple function into a context manager.
644
+ * @strable: mention context manager requirement and @contextual as workaround.
645
+
646
+ *Release 20191006*:
647
+ Rename @cached to @cachedmethod, leave compatible @cached behind which issues a warning (will be removed in a future release).
648
+
649
+ *Release 20191004*:
650
+ Avoid circular import with cs.pfx by removing requirement and doing the import later if needed.
651
+
652
+ *Release 20190905*:
653
+ Bugfix @deco: it turns out that you may not set the .__module__ attribute on a property object.
654
+
655
+ *Release 20190830.2*:
656
+ Make some getattr calls robust.
657
+
658
+ *Release 20190830.1*:
659
+ @decorator: set the __module__ of the wrapper.
660
+
661
+ *Release 20190830*:
662
+ @decorator: set the __module__ of the wrapper from the decorated target, aids cs.distinf.
663
+
664
+ *Release 20190729*:
665
+ @cached: sidestep uninitialised value.
666
+
667
+ *Release 20190601.1*:
668
+ @strable: fix the example in the docstring.
669
+
670
+ *Release 20190601*:
671
+ * Bugfix @decorator to correctly propagate the docstring of the subdecorator.
672
+ * Improve other docstrings.
673
+
674
+ *Release 20190526*:
675
+ @decorator: add support for positional arguments and rewrite - simpler and clearer.
676
+
677
+ *Release 20190512*:
678
+ @fmtdoc: add caveat against misuse of this decorator.
679
+
680
+ *Release 20190404*:
681
+ New @fmtdoc decorator to format a function's doctsring against its module's globals.
682
+
683
+ *Release 20190403*:
684
+ * @cached: bugfix: avoid using unset sig_func value on first pass.
685
+ * @observable_class: further tweaks.
686
+
687
+ *Release 20190322.1*:
688
+ @observable_class: bugfix __init__ wrapper function.
689
+
690
+ *Release 20190322*:
691
+ * New class decorator @observable_class.
692
+ * Bugfix import of "warning".
693
+
694
+ *Release 20190309*:
695
+ @cached: improve the exception handling.
696
+
697
+ *Release 20190307.2*:
698
+ Fix docstring typo.
699
+
700
+ *Release 20190307.1*:
701
+ Bugfix @decorator: final plumbing step for decorated decorator.
702
+
703
+ *Release 20190307*:
704
+ * @decorator: drop unused arguments, they get used by the returned decorator.
705
+ * Rework the @cached logic.
706
+
707
+ *Release 20190220*:
708
+ * Bugfix @decorator decorator, do not decorate twice.
709
+ * Have a cut at inheriting the decorated function's docstring.
710
+
711
+ *Release 20181227*:
712
+ * New decoartor @strable for function which may accept a str instead of their primary type.
713
+ * Improvements to @cached.
714
+
715
+ *Release 20171231*:
716
+ Initial PyPI release.
717
+