PKN'undefined/__init__.py""" a simple package """ __version__ = '0.0.8' import sys import types class Undefined(types.ModuleType): """ Simply a global object that act as undefined. """ __version__ = __version__ @property def Undefined(self): return self def __call__(self, value): return value is self def __eq__(self, other): raise NotImplementedError('Cannot compare undefined') def __repr__(self): return self.__class__.__name__ def __bool__(self): raise NotImplementedError('Undefined is not defined, neither True, nor False.') def __str__(self): raise NotImplementedError("Cannot represent undefined !") Undefined.__name__ = 'Undefined' Undefined = Undefined('undefined', """ Simply a global object that act as undefined. """ ) Undefined.__version__ = __version__ if sys.modules[__name__] is Undefined: print('doing nothing') pass else: sys.modules[__name__] = Undefined PKNP !undefined/tests/test_undefined.pyimport undefined as ud import undefined from undefined import Undefined as uc def test_undefined(): assert ud is uc import unittest class TestUndefined(unittest.TestCase): def test_bool(self): with self.assertRaises(NotImplementedError): if undefined: pass def test_str(self): with self.assertRaises(NotImplementedError): '%s' % undefined PKNX >>!undefined-0.0.8.dist-info/LICENSEThe MIT License (MIT) Copyright (c) 2015 Matthias Bussonnier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK!HPOundefined-0.0.8.dist-info/WHEEL HM K-*ϳR03rOK-J,/RH,szd&Y)r$[)T&UrPK!H`u "undefined-0.0.8.dist-info/METADATAUMoF ϯ ClVPHtmI)K54G#Y7ٶC>>>rnBzSF.y+ֲ.T 1$o]hi$8մ5B+ܢ4l[ K/.Wa䦹֢ S_Uڑ헵|el 7JIsFkv-Na3-[8ʢ[~u> ~D[zeymG]K=> *jW׵tN;")ޭcZYBX4bA/=JzFcFx eP ,#;{c)݆pGkt,`_CFmG t&D(P{xuD[M~o OȲL4dLy4ʄm PerI%Px[8XivȼHwCitf,GHKkXs2-ҫ';Z2p:!V[Sod6ޫCI|Éϑm1+bzV<T䋎N,hI#yKsE=LwTF9JJC +Q6~jc}aZQ,OK敚L5IX(,SmhsIݧ`{6f(z$?UOTfICRep y/"a: 5[M~zq0ZTXIl?xJH:GSs6fbH .&SAFX܆ZZW޴mxz$A{2(Eswvƫ,63oŭ'Y :sNѕ=`:a{ +ZW&qQ^3:9fV1R=#3a:FG*#]7HHM98%kIkIz~y&9lFגƞCQx zi %K?˻r? 2mHM^!mqƮ Zo&4Kx;fb'@S,Nh~ `&3z8f(`1xi'kzjQw2}xe\2;K Z妠7KPK!H6. undefined-0.0.8.dist-info/RECORD}̹@gt؂c\9b8"!l_WY^*IB+% [?A{:.kMX6JM< n&{NJBuy۵M='c 72nwƉXYks>?XElFێUq[`牳ɸʭK#ٙc49zOcq?ca)axUq \6S3@Z}Pm|5 ढ़jg`P 1+Ԉ_>!undefined-0.0.8.dist-info/LICENSEPK!HPOU undefined-0.0.8.dist-info/WHEELPK!H`u " undefined-0.0.8.dist-info/METADATAPK!H6. undefined-0.0.8.dist-info/RECORDPK