task: metadata: install: pip install -e .[dev]
patch: diff --git a/pydicom/uid.py b/pydicom/uid.py
index 483159e47..741450672 100644
--- a/pydicom/uid.py
+++ b/pydicom/uid.py
@@ -162,15 +162,16 @@ class UID(str):
     @property
     def name(self):
         """Return the UID name from the UID dictionary."""
-        if self in UID_dictionary:
+        uid_string = str.__str__(self)
+        if uid_string in UID_dictionary:
             return UID_dictionary[self][0]
 
-        return str.__str__(self)
+        return uid_string
 
     @property
     def type(self):
         """Return the UID type from the UID dictionary."""
-        if self in UID_dictionary:
+        if str.__str__(self) in UID_dictionary:
             return UID_dictionary[self][1]
 
         return ''
@@ -178,7 +179,7 @@ class UID(str):
     @property
     def info(self):
         """Return the UID info from the UID dictionary."""
-        if self in UID_dictionary:
+        if str.__str__(self) in UID_dictionary:
             return UID_dictionary[self][2]
 
         return ''
@@ -186,7 +187,7 @@ class UID(str):
     @property
     def is_retired(self):
         """Return True if the UID is retired, False otherwise or if private."""
-        if self in UID_dictionary:
+        if str.__str__(self) in UID_dictionary:
             return bool(UID_dictionary[self][3])
 
         return False

problem_statement: Crash with specific UIDs
The following crashes with infinite recursion under Python 2.7:
``` python
    def test_name_with_equal_hash(self):
        uid = UID('1.3.12.2.1107.5.2.18.41538.2017072416190348328326500')
        assert uid.name == '1.3.12.2.1107.5.2.18.41538.2017072416190348328326500'
```
If accessing the name, it is checked if the UID string is one of the predefined strings. 
The given UID has the same hash as a predefined UID (Basic Voice Audio Waveform Storage), and therefore the `__eq__` operator is invoked. This operator compares the UID names, what leads to the recursion.

In 0.99 and previous versions, the crash happened in `UID.__init()`, with `AttributeError: 'UID' object has no attribute 'name'` (happened in the field with SOPInstanceUID).
In Python 3, the string hash has changed, so it does not occur there, at least for this specific UID.

repo: pydicom/pydicom
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/pydicom/tests/test_uid.py b/pydicom/tests/test_uid.py
index f035c4cdd..2d7938b89 100644
--- a/pydicom/tests/test_uid.py
+++ b/pydicom/tests/test_uid.py
@@ -3,7 +3,7 @@
 
 import pytest
 
-from pydicom.uid import UID, generate_uid, PYDICOM_ROOT_UID
+from pydicom.uid import UID, generate_uid, PYDICOM_ROOT_UID, JPEGLSLossy
 
 
 class TestGenerateUID(object):
@@ -61,7 +61,6 @@ class TestUID(object):
         assert not self.uid == 'Explicit VR Little Endian'
         # Issue 96
         assert not self.uid == 3
-        assert not self.uid is None
 
     def test_inequality(self):
         """Test that UID.__ne__ works."""
@@ -73,7 +72,6 @@ class TestUID(object):
         assert self.uid != 'Explicit VR Little Endian'
         # Issue 96
         assert self.uid != 3
-        assert self.uid is not None
 
     def test_hash(self):
         """Test that UID.__hash_- works."""
@@ -183,6 +181,21 @@ class TestUID(object):
         assert self.uid.name == 'Implicit VR Little Endian'
         assert UID('1.2.840.10008.5.1.4.1.1.2').name == 'CT Image Storage'
 
+    def test_name_with_equal_hash(self):
+        """Test that UID name works for UID with same hash as predefined UID.
+        """
+        class MockedUID(UID):
+            # Force the UID to return the same hash as one of the
+            # uid dictionary entries (any will work).
+            # The resulting hash collision forces the usage of the `eq`
+            # operator while checking for containment in the uid dictionary
+            # (regression test for issue #499)
+            def __hash__(self):
+                return hash(JPEGLSLossy)
+
+        uid = MockedUID('1.2.3')
+        assert uid.name == '1.2.3'
+
     def test_type(self):
         """Test that UID.type works."""
         assert self.uid.type == 'Transfer Syntax'