name, other ) is True : return False return True def _hash_ ( self ): """Return the hash of `self`.""" # TODO: v1.2 - The _hash_ override is deprecated # For python 3, any override of _cmp_ or _eq_ # immutable requires explicit redirect of hash # function to the parent class # See # reference/datamodel.html#object._hash_ return super ( UID, self ). _eq_ ( self, other ) is True : return False if str. ![]() warn ( msg, DeprecationWarning ) if str. ![]() strip ()) raise TypeError ( "UID must be a string" ) def _eq_ ( self, other ): """Return True if `self` or `self.name` equals `other`.""" # TODO: v1.2 - The _ne_ override is deprecated if isinstance ( other, str ) and other and '.' not in other : msg = "The equality test for \" UID = ' ' \" ". string_types ): return super ( UID, cls ). """ # Don't repeat if already a UID class then may get the name that # str(uid) gives rather than the dotted number if isinstance ( val, UID ): return val if isinstance ( val, compat. Parameters - val : str or The UID string to use to create the UID object. Example - > from pydicom.uid import UID > uid = UID('1.2.840.10008.1.2.4.50') > uid '1.2.840.10008.1.2.4.50' > uid.is_implicit_VR False > uid.is_little_endian True > uid.is_transfer_syntax True > uid.name 'JPEG Baseline (Process 1)' """ def _new_ ( cls, val ): """Setup new instance of the class. ![]() ![]() Class UID ( str ): """Subclass python string so have human-friendly UIDs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |