/usr/lib/python2.6/site-packages/positional
NameSizeModeActions
tests/-0755rm
__init__.py40110644editdlrm
__init__.pyc42130644editdlrm
Edit: /usr/lib/python2.6/site-packages/positional/__init__.pyc (4213B)
Ñò ãyWc@sbddkZddkZddkZddkZeiidƒiƒZde fd„ƒYZ dS(iÿÿÿÿNt positionalcBsVeZdZdZdZded„Zeded„ƒZed„ƒZd„Z RS(srA decorator to enforce passing arguments as keywords. When you have a function that takes a lot of arguments you expect people to pass those arguments as keyword arguments. Python however does not enforce this. In future then if you decide that you want to insert a new argument or rearrange the arguments or transition to using **kwargs you break compatibility with users of your code who (wrongly) gave you 20 positional arguments. In python 3 there is syntax to prevent this however we are not all in the position where we can write python 3 exclusive code. Positional solves the problem in the mean time across both pythons by enforcing that certain arguments must be past as keyword arguments. :param max_positional_args: the maixmum number of arguments that can be passed to this function without keyword parameters. Defaults to enforcing that every parameter with a default value must be passed as a keyword argument. :type max_positional_args int :param enforcement: defines the way incorrect usage is reported. Currenlty accepts :py:attr:`positional.EXCEPT` to raise a TypeError or :py:attr:`positional.WARN` to show a warning. A warning can be useful for applying to functions that are already public as a deprecation notice. Defaults to :py:attr:`positional.EXCEPT`. texcepttwarncCs||_||_dS(N(t_max_positional_argst _enforcement(tselftmax_positional_argst enforcement((s7/usr/lib/python2.6/site-packages/positional/__init__.pyt__init__5s cs4ˆdj oˆd7‰n‡‡‡fd†}|S(Nicsˆˆˆƒ|ƒS(N((tfunc(RRtcls(s7/usr/lib/python2.6/site-packages/positional/__init__.pytf>s(tNone(R RRR ((RRR s7/usr/lib/python2.6/site-packages/positional/__init__.pytmethod9s cs‡‡‡fd†}|S(NcstˆiˆˆŽ|ƒƒS(N(t classmethodR (R (tkwargstargsR (s7/usr/lib/python2.6/site-packages/positional/__init__.pyR Ds((R RRR ((RRR s7/usr/lib/python2.6/site-packages/positional/__init__.pyRBscs„ˆidjo2ti|ƒ}t|iƒt|iƒˆ_nˆidjodnd‰ti‡‡fd†ƒ}||ƒS(Nittscs¾t|ƒ}|o|d7}n|ˆijo€dh|id6ˆid6|d6ˆd6}ˆiˆijot|ƒ‚q±ˆiˆijoti|t ddƒq±n|||ŽS( NisN%(name)s takes at most %(max)d positional argument%(plural)s (%(given)d given)tnametmaxtgiventpluralt stackleveli( tlenRt__name__RtEXCEPTt TypeErrortWARNtwarningsRtDeprecationWarning(twrappedtinstanceRRtargs_lentmessage(RR(s7/usr/lib/python2.6/site-packages/positional/__init__.pytinnerOs    ( RR tinspectt getargspecRRtdefaultstwraptt decorator(RR tspecR#((RRs7/usr/lib/python2.6/site-packages/positional/__init__.pyt__call__Hs #N( Rt __module__t__doc__RRR RRR R*(((s7/usr/lib/python2.6/site-packages/positional/__init__.pyRs( R$Rt pbr.versiontpbrR'tversiont VersionInfotversion_stringt __version__tobjectR(((s7/usr/lib/python2.6/site-packages/positional/__init__.pyt s