PKL5JȾZ00unstable/.__init__.py.swpb0VIM 8.0МX0,bussonniermatthiasMacBook-Pro-3.local~bussonniermatthias/dev/mistune/unstable/unstable/__init__.py 3210#"! UtpfadY fYDCa > - ) (  d c K F .  S -  q :   { * j3}|oU<# xV6Jo4'&%$     unstable = Unstable() print('this seem tobe sunstable = Unstable() print('this seem tobeunstable = Unsunstable = Unstable() print('this seem tobe stable now', len(warns)) category=StableWarning, stacklevel=1) "unstable features, these feature may stable now.", warnings.warn("An unstable context manager has caught no use of " if catcher.param == 'count' and len(warns) == 0: warnings.showwarning(w.message, w.category, w.filename, w.lineno, w.file, w.line) for w in warns: if catcher.param not in ('ignore', 'count'): catcher.__exit__(a,b,c) warns = self._warns.pop() catcher = self._catch.pop() def __exit__(self, a,b,c): warnings.filterwarnings(p, category=UnstableWarning, append=False) p = 'always' if p == 'count': catcher.param = p p = 'count' else: p = self._params.pop() if self._params: self._warns.append(catcher.__enter__()) self._catch.append(catcher) catcher = warnings.catch_warnings(record=True) def __enter__(self): UnstableWarning, stacklevel=3) 'with the appropriate `unstable` context manager.'% (what, what.__qualname__), warnings.warn('You are using an unstable feature (%r, %r), please wrap ' def here_be_dragons(self, what): return self self._params.append(maybe_function) if maybe_function: else: return function return maybe_function(*args, **kwargs) self.here_be_dragons(maybe_function) def function(*args, **kwargs): @wraps(maybe_function) ### called as a context manager if callable(maybe_function): def __call__(self, maybe_function=None): return '' def __repr__(self): self._warns = [] self._catch = [] self._params = [] def __init__(self): class Unstable(object):warnings.filterwarnings('error', category=UnstableWarning) passclass StableWarning(Warning): passclass UnstableWarning(FutureWarning): from functools import wrapsimport warnings"""`StableWarning`.manager that does not detect any use of `unstable` functions will log aexceptions raised by unstable functions. By default an `unstable` contextProvide an `with unstable()` context manger which silence (or log) thecontext. Thus preventing you from using an unstable function by mistake.function will **raise** an ``UnstableWarning``unless used in an `unstable`This module provides a decorator to mark function as `unstable`. Unstable=======UtilityBecause once it's stable, you'll forget to re-check again.takes too much time.Because often, reaching to the documentation to know if something is stableenough.Because sometime documenting a function is unstable is not========Unstable"""PK-5J"runstable/.__init__.py.un~VimUnDoqWN8iA,ƝX7ogxȧ[?mqqqqX_X5_XMimport warnings5_XO5_XQ5_X V5_X$Not reading documentation for human.5_XW========5_ QXYSBecause informations sometime documenting that something is unstable is not enough.5_ X! Zenough.5_ X)\KBecause informations sometime documenting that something is unstable is not5_ "X.\>Because sometime documenting that something is unstable is not5_ 'X0\9Because sometime documenting something is unstable is not5_   X6 \ Because som5_ ZXM \[Because often, reaching to the documentation to know if something is not stable is toolong.5_ XP ] is toolong.5_ XW ]OBecause often, reaching to the documentation to know if something is not stable. ] is too long.5_VX^ \^Because often, reaching to the documentation to know if something is stable takes too juch ti.5_WX` \^Because often, reaching to the documentation to know if something is stable takes too juch ti.5_]Xb \^Because often, reaching to the documentation to know if something is stable takes too much ti.5_^Xc \`Because often, reaching to the documentation to know if something is stable takes too much time.5_ Xd ]takes too much time.5_ +Xy _7Because once it's stable, you'll forget to check again.5_ :X~ _:Because once it's stable, you'll forget to re-check again.5_X b =5_ X bUtility:5_X b========5_X b=======5_Xe1Provide a decorator to mark function as unstable.5_XeThis module Provides a decorator to mark function as unstable.5_!#">Xe>This module provides a decorator to mark function as unstable.5_"$#5Xf>This module provides a decorator to mark function as unstable.5_#%$>Xf?This module provides a decorator to mark function as `unstable.5_$&%@Xf@This module provides a decorator to mark function as `unstable`.5_%'& Xg0Unstable function will raise an UnstableWarning`5_&('Xg1Unstable function will raise an `UnstableWarning`5_')(Xg3Unstable function will **raise an `UnstableWarning`5_(*)$Xg5Unstable function will **raise** an `UnstableWarning`5_)+*6Xg6Unstable function will **raise** an ``UnstableWarning`5_*,+8Xg8Unstable function will **raise** an ``UnstableWarning`` 5_+-,8Xi8Unstable function will **raise** an ``UnstableWarning``.5_,/-;XiZUnstable function will **raise** an ``UnstableWarning``. THus preventing you from using a 5_-0./:Xi@This module provides a decorator to mark function as `unstable`.ZUnstable function will **raise** an ``UnstableWarning``. Thus preventing you from using a 5_/10Xja 5_021X jProvid5_132 Xj an unstable function by mistake.5_243.XjNfunction will **raise** an ``UnstableWarning``. Thus preventing you from using5_354AX jbfunction will **raise** an ``UnstableWarning``unless used in an ``. Thus preventing you from using5_465JX#jjfunction will **raise** an ``UnstableWarning``unless used in an `unstable`. Thus preventing you from using5_576KX+jrfunction will **raise** an ``UnstableWarning``unless used in an `unstable` context. Thus preventing you from using5_687X-kIThis module provides a decorator to mark function as `unstable`. UnstableJfunction will **raise** an ``UnstableWarning``unless used in an `unstable`'context. Thus preventing you from using+an unstable function by mistake, unless use5_798OX7kOcontext. Thus preventing you from using an unstable function by mistake, unless5_8:9X9use5_9;:HX:jHcontext. Thus preventing you from using an unstable function by mistake.5_:<; XEl Provide an ``5_;=<XGlProvide an `@unstable`5_<>=XMl$Provide an `@unstable`context manger5_=?>%XUl%Provide an `@unstable` context manger5_>@?=Xel>Provide an `@unstable` context manger which silence (or print)5_?A@<XglXm>raised by unstable functions. By default an `unstable` context5_LNMhXmiraised by unstable functions. By default an `unstable` context manager that does not detect any use of ``5_MONqXmqraised by unstable functions. By default an `unstable` context manager that does not detect any use of `unstable`5_NPOzXmQProvide an `with unstable()` context manger which silence (or log) the exceptions{raised by unstable functions. By default an `unstable` context manager that does not detect any use of `unstable` functions5_OQP<Xn' , def __call__(self, maybe_function=None):% if callable(maybe_function):+ ### called as a context manager " @wraps(maybe_function)* def function(*args, **kwargs):4 self.here_be_dragons(maybe_function)6 return maybe_function(*args, **kwargs) return function else: if maybe_function:3 self._params.append(maybe_function) return self $ def here_be_dragons(self, what):P warnings.warn('You are using an unstable feature (%r, %r), please wrap 'd 'with the appropriate `unstable` context manager.'% (what, what.__qualname__),4 UnstableWarning, stacklevel=3)  def __enter__(self):6 catcher = warnings.catch_warnings(record=True)# self._catch.append(catcher)/ self._warns.append(catcher.__enter__()) if self._params:" p = self._params.pop() else: p = 'count'  catcher.param = p if p == 'count': p = 'always'  J warnings.filterwarnings(p, category=UnstableWarning, append=False)  def __exit__(self, a,b,c):# catcher = self._catch.pop()! warns = self._warns.pop() catcher.__exit__(a,b,c)4 if catcher.param not in ('ignore', 'count'): for w in warns:a warnings.showwarning(w.message, w.category, w.filename, w.lineno, w.file, w.line)8 if catcher.param == 'count' and len(warns) == 0:M warnings.warn("An unstable context manager has caught no use of "M "unstable features, these feature may stable now.", > category=StableWarning, stacklevel=1): print('this seem tobe stable now', len(warns)) unstable = Unstable()5_-/.:XiIThis module provides a decorator to mark function as `unstable`. UnstableNfunction will **raise** an ``UnstableWarning``. Thus preventing you from usinga 5PK-5Ju^ unstable/__init__.py""" Unstable ======== Because sometime documenting a function is unstable is not enough. Because often, reaching to the documentation to know if something is stable takes too much time. Because once it's stable, you'll forget to re-check again. Utility ======= This module provides a decorator to mark function as `unstable`. Unstable function will **raise** an ``UnstableWarning``unless used in an `unstable` context. Thus preventing you from using an unstable function by mistake. Provide an `with unstable()` context manger which silence (or log) the exceptions raised by unstable functions. By default an `unstable` context manager that does not detect any use of `unstable` functions will log a `StableWarning`. See Readme for more information. """ version_info = (0,5,0) __version__ = '.'.join(map(str, version_info)) import warnings from functools import wraps __all__ = ('UnstableWarning', 'StableWarning', 'unstable') class UnstableWarning(FutureWarning): pass class StableWarning(Warning): pass warnings.filterwarnings('error', category=UnstableWarning) class Unstable(object): def __init__(self): self._params = [] self._catch = [] self._warns = [] def __repr__(self): return '' def __call__(self, maybe_function=None): if callable(maybe_function): ### called as a context manager @wraps(maybe_function) def function(*args, **kwargs): self.here_be_dragons(maybe_function) return maybe_function(*args, **kwargs) return function else: if maybe_function: self._params.append(maybe_function) return self def here_be_dragons(self, what): warnings.warn('You are using an unstable feature (%r, %r), please wrap ' 'with the appropriate `unstable` context manager.'% (what, what.__qualname__), UnstableWarning, stacklevel=3) def __enter__(self): catcher = warnings.catch_warnings(record=True) self._catch.append(catcher) self._warns.append(catcher.__enter__()) if self._params: p = self._params.pop() else: p = 'count' catcher.param = p if p == 'count': p = 'always' warnings.filterwarnings(p, category=UnstableWarning, append=False) def __exit__(self, a,b,c): catcher = self._catch.pop() warns = self._warns.pop() catcher.__exit__(a,b,c) if catcher.param not in ('ignore', 'count'): for w in warns: warnings.showwarning(w.message, w.category, w.filename, w.lineno, w.file, w.line) if catcher.param == 'count' and len(warns) == 0: warnings.warn("An unstable context manager has caught no use of " "unstable features, these feature may stable now.", category=StableWarning, stacklevel=1) print('this seem tobe stable now', len(warns)) unstable = Unstable() PK!H;@QPunstable-0.5.0.dist-info/WHEEL1 0 RZq+D-Dv;_[*7Fp ܦpv/fݞoL(*IPK!H7 !unstable-0.5.0.dist-info/METADATAV[o6~8HP`0ЭIִKabJ-"G~ߡ,Ҿl~$ ? K_ym͜^fĵlԜAًuBƦӗAmY+WPBh|C;霒|.rkqCeݜ>*-=]F1Zٙj甏FOؑQ_vʟ}xyxWKs8>^E:J~m8xT1FQi(Ye4E8?26lk.23ERe2ƮI/{I7<,5C` ':OꚖ֭T`N*I6g{Łu/%V#tC'][F$8qI*Ua ֱ/"L--ƣZ驓ګSA^:$P+=& FEaMP!*z6LZ:@/gl`O)_GtA7ϬuA׵b'Ƚ)s+sZ)Uo\.;@) |Iv*P2*t*XvUG=XTo%K7:Ԑc*̻w<KAܣu[ ŢM'zǖhZŽi35yDFgKSbj:OeulZQnJ?In \1#X{4?oP*CJ'Wb{s2sQLGcʲ,C{JMERIOT\=5큎6⻅HB~{ ԧ쳟p3zz9KU' LK0?H=&>%Rc6ߏaGe{~„N_t3!DPGt#W|<;"w\+2 #ttPÚZNUǡ`X}iD in>MC扡Fݑznk]Pwbv& ,41syT#)Y^&3AL3Ne-M<9 bx+TΞ驿o0TkaPu-tk9p&ymix4Ps57m9`R &<͟iSZsD6;azxhx@]ԾGi7iq08q8>=ȹb&iJ4b@Wюd(vзyze%x |qY8& 4\wB\%jV=⹳‹:ac]/`x|; PK!H.<*unstable-0.5.0.dist-info/RECORD}λr@@>".<HypUuA"ߞ4d,w܁?f|J