Sunday, October 11, 2015

Python type casts

I wanted to show examples of Python 3 types and the effect of explicitly trying to cast members of one type to another so wrote the following code. It works, but the string values of a few types, such as iter (and memoryview which I ditched), don't show the values.

Oh well, here is the code:

from fractions import Fraction
from decimal import Decimal, getcontext
getcontext().prec = 60
from itertools import product
 
casting_functions = [int, float, complex,   # Numbers
                     Fraction, Decimal,     # Numbers
                     hex, oct, bin,         # Int representations - not strictly types
                     bool,                  # Boolean/integer Number
                     iter,                  # Iterator type
                     list, tuple, range,    # Sequence types
                     str, bytes,            # Strings, byte strings
                     bytearray,             # Mutable bytes
                     set, frozenset,        # Set, hashable set
                     dict,                  # hash mapping dictionary
                    ]
 
examples_of_types = [0, 42, 
                     0.0 -0.0, 12.34, 56.0, 
                     (0+0j), (1+2j), (1+0j), (78.9+0j), (0+1.2j),
                     Fraction(0, 1), Fraction(22, 7), Fraction(4, 2), 
                     Decimal('0'),
                     Decimal('3.14159265358979323846264338327950288419716939937510'),
                     Decimal('1'), Decimal('1.5'),
                     True, False,
                     iter(()), iter([1, 2, 3]), iter({'A', 'B', 'C'}), 
                     iter([[1, 2], [3, 4]]), iter((('a', 1), (2, 'b'))),
                     [], [1, 2], [[1, 2], [3, 4]],
                     (), (1, 'two', (3+0j)), (('a', 1), (2, 'b')),
                     range(0), range(3),
                     "", "A", "ABBA", "Milü",
                     b"", b"A", b"ABBA",
                     bytearray(b""), bytearray(b"A"), bytearray(b"ABBA"),
                     set(), {1, 'two', (3+0j), (4, 5, 6)},
                     frozenset(), frozenset({1, 'two', (3+0j), (4, 5, 6)}),
                     {}, {1: 'one', 'two': (2+3j), ('RC', 3): None} 
                    ]
if __name__ == '__main__':
    print('Common Python types/type casting functions:')
    print('  ' + '\n  '.join(f.__name__ for f in casting_functions))
    print('\nExamples of those types:')
    print('  ' + '\n  '.join('%-26s %r' % (type(e), e) for e in examples_of_types))
    print('\nCasts of the examples:')
    for f, e in product(casting_functions, examples_of_types):
        try:
            ans = f(e)
        except BaseException:
            ans = 'EXCEPTION RAISED!'
        print('%-60s -> %r' % ('%s(%r)' % (f.__name__, e), ans))
Output:
Common Python types/type casting functions:
  int
  float
  complex
  Fraction
  Decimal
  hex
  oct
  bin
  bool
  iter
  list
  tuple
  range
  str
  bytes
  bytearray
  set
  frozenset
  dict

Examples of those types:
                0
                42
              0.0
              12.34
              56.0
            0j
            (1+2j)
            (1+0j)
            (78.9+0j)
            1.2j
   Fraction(0, 1)
   Fraction(22, 7)
   Fraction(2, 1)
    Decimal('0')
    Decimal('3.14159265358979323846264338327950288419716939937510')
    Decimal('1')
    Decimal('1.5')
               True
               False
     
      
       
      
     
               []
               [1, 2]
               [[1, 2], [3, 4]]
              ()
              (1, 'two', (3+0j))
              (('a', 1), (2, 'b'))
              range(0, 0)
              range(0, 3)
                ''
                'A'
                'ABBA'
                'Milü'
              b''
              b'A'
              b'ABBA'
          bytearray(b'')
          bytearray(b'A')
          bytearray(b'ABBA')
                set()
                {1, 'two', (3+0j), (4, 5, 6)}
          frozenset()
          frozenset({1, 'two', (3+0j), (4, 5, 6)})
               {}
               {1: 'one', 'two': (2+3j), ('RC', 3): None}

Casts of the examples:
int(0)                                                       -> 0
int(42)                                                      -> 42
int(0.0)                                                     -> 0
int(12.34)                                                   -> 12
int(56.0)                                                    -> 56
int(0j)                                                      -> 'EXCEPTION RAISED!'
int((1+2j))                                                  -> 'EXCEPTION RAISED!'
int((1+0j))                                                  -> 'EXCEPTION RAISED!'
int((78.9+0j))                                               -> 'EXCEPTION RAISED!'
int(1.2j)                                                    -> 'EXCEPTION RAISED!'
int(Fraction(0, 1))                                          -> 0
int(Fraction(22, 7))                                         -> 3
int(Fraction(2, 1))                                          -> 2
int(Decimal('0'))                                            -> 0
int(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 3
int(Decimal('1'))                                            -> 1
int(Decimal('1.5'))                                          -> 1
int(True)                                                    -> 1
int(False)                                                   -> 0
int()           -> 'EXCEPTION RAISED!'
int()            -> 'EXCEPTION RAISED!'
int()             -> 'EXCEPTION RAISED!'
int()            -> 'EXCEPTION RAISED!'
int()           -> 'EXCEPTION RAISED!'
int([])                                                      -> 'EXCEPTION RAISED!'
int([1, 2])                                                  -> 'EXCEPTION RAISED!'
int([[1, 2], [3, 4]])                                        -> 'EXCEPTION RAISED!'
int(())                                                      -> 'EXCEPTION RAISED!'
int((1, 'two', (3+0j)))                                      -> 'EXCEPTION RAISED!'
int((('a', 1), (2, 'b')))                                    -> 'EXCEPTION RAISED!'
int(range(0, 0))                                             -> 'EXCEPTION RAISED!'
int(range(0, 3))                                             -> 'EXCEPTION RAISED!'
int('')                                                      -> 'EXCEPTION RAISED!'
int('A')                                                     -> 'EXCEPTION RAISED!'
int('ABBA')                                                  -> 'EXCEPTION RAISED!'
int('Milü')                                                  -> 'EXCEPTION RAISED!'
int(b'')                                                     -> 'EXCEPTION RAISED!'
int(b'A')                                                    -> 'EXCEPTION RAISED!'
int(b'ABBA')                                                 -> 'EXCEPTION RAISED!'
int(bytearray(b''))                                          -> 'EXCEPTION RAISED!'
int(bytearray(b'A'))                                         -> 'EXCEPTION RAISED!'
int(bytearray(b'ABBA'))                                      -> 'EXCEPTION RAISED!'
int(set())                                                   -> 'EXCEPTION RAISED!'
int({1, 'two', (3+0j), (4, 5, 6)})                           -> 'EXCEPTION RAISED!'
int(frozenset())                                             -> 'EXCEPTION RAISED!'
int(frozenset({1, 'two', (3+0j), (4, 5, 6)}))                -> 'EXCEPTION RAISED!'
int({})                                                      -> 'EXCEPTION RAISED!'
int({1: 'one', 'two': (2+3j), ('RC', 3): None})              -> 'EXCEPTION RAISED!'
float(0)                                                     -> 0.0
float(42)                                                    -> 42.0
float(0.0)                                                   -> 0.0
float(12.34)                                                 -> 12.34
float(56.0)                                                  -> 56.0
float(0j)                                                    -> 'EXCEPTION RAISED!'
float((1+2j))                                                -> 'EXCEPTION RAISED!'
float((1+0j))                                                -> 'EXCEPTION RAISED!'
float((78.9+0j))                                             -> 'EXCEPTION RAISED!'
float(1.2j)                                                  -> 'EXCEPTION RAISED!'
float(Fraction(0, 1))                                        -> 0.0
float(Fraction(22, 7))                                       -> 3.142857142857143
float(Fraction(2, 1))                                        -> 2.0
float(Decimal('0'))                                          -> 0.0
float(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 3.141592653589793
float(Decimal('1'))                                          -> 1.0
float(Decimal('1.5'))                                        -> 1.5
float(True)                                                  -> 1.0
float(False)                                                 -> 0.0
float()         -> 'EXCEPTION RAISED!'
float()          -> 'EXCEPTION RAISED!'
float()           -> 'EXCEPTION RAISED!'
float()          -> 'EXCEPTION RAISED!'
float()         -> 'EXCEPTION RAISED!'
float([])                                                    -> 'EXCEPTION RAISED!'
float([1, 2])                                                -> 'EXCEPTION RAISED!'
float([[1, 2], [3, 4]])                                      -> 'EXCEPTION RAISED!'
float(())                                                    -> 'EXCEPTION RAISED!'
float((1, 'two', (3+0j)))                                    -> 'EXCEPTION RAISED!'
float((('a', 1), (2, 'b')))                                  -> 'EXCEPTION RAISED!'
float(range(0, 0))                                           -> 'EXCEPTION RAISED!'
float(range(0, 3))                                           -> 'EXCEPTION RAISED!'
float('')                                                    -> 'EXCEPTION RAISED!'
float('A')                                                   -> 'EXCEPTION RAISED!'
float('ABBA')                                                -> 'EXCEPTION RAISED!'
float('Milü')                                                -> 'EXCEPTION RAISED!'
float(b'')                                                   -> 'EXCEPTION RAISED!'
float(b'A')                                                  -> 'EXCEPTION RAISED!'
float(b'ABBA')                                               -> 'EXCEPTION RAISED!'
float(bytearray(b''))                                        -> 'EXCEPTION RAISED!'
float(bytearray(b'A'))                                       -> 'EXCEPTION RAISED!'
float(bytearray(b'ABBA'))                                    -> 'EXCEPTION RAISED!'
float(set())                                                 -> 'EXCEPTION RAISED!'
float({1, 'two', (3+0j), (4, 5, 6)})                         -> 'EXCEPTION RAISED!'
float(frozenset())                                           -> 'EXCEPTION RAISED!'
float(frozenset({1, 'two', (3+0j), (4, 5, 6)}))              -> 'EXCEPTION RAISED!'
float({})                                                    -> 'EXCEPTION RAISED!'
float({1: 'one', 'two': (2+3j), ('RC', 3): None})            -> 'EXCEPTION RAISED!'
complex(0)                                                   -> 0j
complex(42)                                                  -> (42+0j)
complex(0.0)                                                 -> 0j
complex(12.34)                                               -> (12.34+0j)
complex(56.0)                                                -> (56+0j)
complex(0j)                                                  -> 0j
complex((1+2j))                                              -> (1+2j)
complex((1+0j))                                              -> (1+0j)
complex((78.9+0j))                                           -> (78.9+0j)
complex(1.2j)                                                -> 1.2j
complex(Fraction(0, 1))                                      -> 0j
complex(Fraction(22, 7))                                     -> (3.142857142857143+0j)
complex(Fraction(2, 1))                                      -> (2+0j)
complex(Decimal('0'))                                        -> 0j
complex(Decimal('3.14159265358979323846264338327950288419716939937510')) -> (3.141592653589793+0j)
complex(Decimal('1'))                                        -> (1+0j)
complex(Decimal('1.5'))                                      -> (1.5+0j)
complex(True)                                                -> (1+0j)
complex(False)                                               -> 0j
complex()       -> 'EXCEPTION RAISED!'
complex()        -> 'EXCEPTION RAISED!'
complex()         -> 'EXCEPTION RAISED!'
complex()        -> 'EXCEPTION RAISED!'
complex()       -> 'EXCEPTION RAISED!'
complex([])                                                  -> 'EXCEPTION RAISED!'
complex([1, 2])                                              -> 'EXCEPTION RAISED!'
complex([[1, 2], [3, 4]])                                    -> 'EXCEPTION RAISED!'
complex(())                                                  -> 'EXCEPTION RAISED!'
complex((1, 'two', (3+0j)))                                  -> 'EXCEPTION RAISED!'
complex((('a', 1), (2, 'b')))                                -> 'EXCEPTION RAISED!'
complex(range(0, 0))                                         -> 'EXCEPTION RAISED!'
complex(range(0, 3))                                         -> 'EXCEPTION RAISED!'
complex('')                                                  -> 'EXCEPTION RAISED!'
complex('A')                                                 -> 'EXCEPTION RAISED!'
complex('ABBA')                                              -> 'EXCEPTION RAISED!'
complex('Milü')                                              -> 'EXCEPTION RAISED!'
complex(b'')                                                 -> 'EXCEPTION RAISED!'
complex(b'A')                                                -> 'EXCEPTION RAISED!'
complex(b'ABBA')                                             -> 'EXCEPTION RAISED!'
complex(bytearray(b''))                                      -> 'EXCEPTION RAISED!'
complex(bytearray(b'A'))                                     -> 'EXCEPTION RAISED!'
complex(bytearray(b'ABBA'))                                  -> 'EXCEPTION RAISED!'
complex(set())                                               -> 'EXCEPTION RAISED!'
complex({1, 'two', (3+0j), (4, 5, 6)})                       -> 'EXCEPTION RAISED!'
complex(frozenset())                                         -> 'EXCEPTION RAISED!'
complex(frozenset({1, 'two', (3+0j), (4, 5, 6)}))            -> 'EXCEPTION RAISED!'
complex({})                                                  -> 'EXCEPTION RAISED!'
complex({1: 'one', 'two': (2+3j), ('RC', 3): None})          -> 'EXCEPTION RAISED!'
Fraction(0)                                                  -> Fraction(0, 1)
Fraction(42)                                                 -> Fraction(42, 1)
Fraction(0.0)                                                -> Fraction(0, 1)
Fraction(12.34)                                              -> Fraction(3473401212609495, 281474976710656)
Fraction(56.0)                                               -> Fraction(56, 1)
Fraction(0j)                                                 -> 'EXCEPTION RAISED!'
Fraction((1+2j))                                             -> 'EXCEPTION RAISED!'
Fraction((1+0j))                                             -> 'EXCEPTION RAISED!'
Fraction((78.9+0j))                                          -> 'EXCEPTION RAISED!'
Fraction(1.2j)                                               -> 'EXCEPTION RAISED!'
Fraction(Fraction(0, 1))                                     -> Fraction(0, 1)
Fraction(Fraction(22, 7))                                    -> Fraction(22, 7)
Fraction(Fraction(2, 1))                                     -> Fraction(2, 1)
Fraction(Decimal('0'))                                       -> Fraction(0, 1)
Fraction(Decimal('3.14159265358979323846264338327950288419716939937510')) -> Fraction(31415926535897932384626433832795028841971693993751, 10000000000000000000000000000000000000000000000000)
Fraction(Decimal('1'))                                       -> Fraction(1, 1)
Fraction(Decimal('1.5'))                                     -> Fraction(3, 2)
Fraction(True)                                               -> Fraction(1, 1)
Fraction(False)                                              -> Fraction(0, 1)
Fraction()      -> 'EXCEPTION RAISED!'
Fraction()       -> 'EXCEPTION RAISED!'
Fraction()        -> 'EXCEPTION RAISED!'
Fraction()       -> 'EXCEPTION RAISED!'
Fraction()      -> 'EXCEPTION RAISED!'
Fraction([])                                                 -> 'EXCEPTION RAISED!'
Fraction([1, 2])                                             -> 'EXCEPTION RAISED!'
Fraction([[1, 2], [3, 4]])                                   -> 'EXCEPTION RAISED!'
Fraction(())                                                 -> 'EXCEPTION RAISED!'
Fraction((1, 'two', (3+0j)))                                 -> 'EXCEPTION RAISED!'
Fraction((('a', 1), (2, 'b')))                               -> 'EXCEPTION RAISED!'
Fraction(range(0, 0))                                        -> 'EXCEPTION RAISED!'
Fraction(range(0, 3))                                        -> 'EXCEPTION RAISED!'
Fraction('')                                                 -> 'EXCEPTION RAISED!'
Fraction('A')                                                -> 'EXCEPTION RAISED!'
Fraction('ABBA')                                             -> 'EXCEPTION RAISED!'
Fraction('Milü')                                             -> 'EXCEPTION RAISED!'
Fraction(b'')                                                -> 'EXCEPTION RAISED!'
Fraction(b'A')                                               -> 'EXCEPTION RAISED!'
Fraction(b'ABBA')                                            -> 'EXCEPTION RAISED!'
Fraction(bytearray(b''))                                     -> 'EXCEPTION RAISED!'
Fraction(bytearray(b'A'))                                    -> 'EXCEPTION RAISED!'
Fraction(bytearray(b'ABBA'))                                 -> 'EXCEPTION RAISED!'
Fraction(set())                                              -> 'EXCEPTION RAISED!'
Fraction({1, 'two', (3+0j), (4, 5, 6)})                      -> 'EXCEPTION RAISED!'
Fraction(frozenset())                                        -> 'EXCEPTION RAISED!'
Fraction(frozenset({1, 'two', (3+0j), (4, 5, 6)}))           -> 'EXCEPTION RAISED!'
Fraction({})                                                 -> 'EXCEPTION RAISED!'
Fraction({1: 'one', 'two': (2+3j), ('RC', 3): None})         -> 'EXCEPTION RAISED!'
Decimal(0)                                                   -> Decimal('0')
Decimal(42)                                                  -> Decimal('42')
Decimal(0.0)                                                 -> Decimal('0')
Decimal(12.34)                                               -> Decimal('12.339999999999999857891452847979962825775146484375')
Decimal(56.0)                                                -> Decimal('56')
Decimal(0j)                                                  -> 'EXCEPTION RAISED!'
Decimal((1+2j))                                              -> 'EXCEPTION RAISED!'
Decimal((1+0j))                                              -> 'EXCEPTION RAISED!'
Decimal((78.9+0j))                                           -> 'EXCEPTION RAISED!'
Decimal(1.2j)                                                -> 'EXCEPTION RAISED!'
Decimal(Fraction(0, 1))                                      -> 'EXCEPTION RAISED!'
Decimal(Fraction(22, 7))                                     -> 'EXCEPTION RAISED!'
Decimal(Fraction(2, 1))                                      -> 'EXCEPTION RAISED!'
Decimal(Decimal('0'))                                        -> Decimal('0')
Decimal(Decimal('3.14159265358979323846264338327950288419716939937510')) -> Decimal('3.14159265358979323846264338327950288419716939937510')
Decimal(Decimal('1'))                                        -> Decimal('1')
Decimal(Decimal('1.5'))                                      -> Decimal('1.5')
Decimal(True)                                                -> Decimal('1')
Decimal(False)                                               -> Decimal('0')
Decimal()       -> 'EXCEPTION RAISED!'
Decimal()        -> 'EXCEPTION RAISED!'
Decimal()         -> 'EXCEPTION RAISED!'
Decimal()        -> 'EXCEPTION RAISED!'
Decimal()       -> 'EXCEPTION RAISED!'
Decimal([])                                                  -> 'EXCEPTION RAISED!'
Decimal([1, 2])                                              -> 'EXCEPTION RAISED!'
Decimal([[1, 2], [3, 4]])                                    -> 'EXCEPTION RAISED!'
Decimal(())                                                  -> 'EXCEPTION RAISED!'
Decimal((1, 'two', (3+0j)))                                  -> 'EXCEPTION RAISED!'
Decimal((('a', 1), (2, 'b')))                                -> 'EXCEPTION RAISED!'
Decimal(range(0, 0))                                         -> 'EXCEPTION RAISED!'
Decimal(range(0, 3))                                         -> 'EXCEPTION RAISED!'
Decimal('')                                                  -> 'EXCEPTION RAISED!'
Decimal('A')                                                 -> 'EXCEPTION RAISED!'
Decimal('ABBA')                                              -> 'EXCEPTION RAISED!'
Decimal('Milü')                                              -> 'EXCEPTION RAISED!'
Decimal(b'')                                                 -> 'EXCEPTION RAISED!'
Decimal(b'A')                                                -> 'EXCEPTION RAISED!'
Decimal(b'ABBA')                                             -> 'EXCEPTION RAISED!'
Decimal(bytearray(b''))                                      -> 'EXCEPTION RAISED!'
Decimal(bytearray(b'A'))                                     -> 'EXCEPTION RAISED!'
Decimal(bytearray(b'ABBA'))                                  -> 'EXCEPTION RAISED!'
Decimal(set())                                               -> 'EXCEPTION RAISED!'
Decimal({1, 'two', (3+0j), (4, 5, 6)})                       -> 'EXCEPTION RAISED!'
Decimal(frozenset())                                         -> 'EXCEPTION RAISED!'
Decimal(frozenset({1, 'two', (3+0j), (4, 5, 6)}))            -> 'EXCEPTION RAISED!'
Decimal({})                                                  -> 'EXCEPTION RAISED!'
Decimal({1: 'one', 'two': (2+3j), ('RC', 3): None})          -> 'EXCEPTION RAISED!'
hex(0)                                                       -> '0x0'
hex(42)                                                      -> '0x2a'
hex(0.0)                                                     -> 'EXCEPTION RAISED!'
hex(12.34)                                                   -> 'EXCEPTION RAISED!'
hex(56.0)                                                    -> 'EXCEPTION RAISED!'
hex(0j)                                                      -> 'EXCEPTION RAISED!'
hex((1+2j))                                                  -> 'EXCEPTION RAISED!'
hex((1+0j))                                                  -> 'EXCEPTION RAISED!'
hex((78.9+0j))                                               -> 'EXCEPTION RAISED!'
hex(1.2j)                                                    -> 'EXCEPTION RAISED!'
hex(Fraction(0, 1))                                          -> 'EXCEPTION RAISED!'
hex(Fraction(22, 7))                                         -> 'EXCEPTION RAISED!'
hex(Fraction(2, 1))                                          -> 'EXCEPTION RAISED!'
hex(Decimal('0'))                                            -> 'EXCEPTION RAISED!'
hex(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
hex(Decimal('1'))                                            -> 'EXCEPTION RAISED!'
hex(Decimal('1.5'))                                          -> 'EXCEPTION RAISED!'
hex(True)                                                    -> '0x1'
hex(False)                                                   -> '0x0'
hex()           -> 'EXCEPTION RAISED!'
hex()            -> 'EXCEPTION RAISED!'
hex()             -> 'EXCEPTION RAISED!'
hex()            -> 'EXCEPTION RAISED!'
hex()           -> 'EXCEPTION RAISED!'
hex([])                                                      -> 'EXCEPTION RAISED!'
hex([1, 2])                                                  -> 'EXCEPTION RAISED!'
hex([[1, 2], [3, 4]])                                        -> 'EXCEPTION RAISED!'
hex(())                                                      -> 'EXCEPTION RAISED!'
hex((1, 'two', (3+0j)))                                      -> 'EXCEPTION RAISED!'
hex((('a', 1), (2, 'b')))                                    -> 'EXCEPTION RAISED!'
hex(range(0, 0))                                             -> 'EXCEPTION RAISED!'
hex(range(0, 3))                                             -> 'EXCEPTION RAISED!'
hex('')                                                      -> 'EXCEPTION RAISED!'
hex('A')                                                     -> 'EXCEPTION RAISED!'
hex('ABBA')                                                  -> 'EXCEPTION RAISED!'
hex('Milü')                                                  -> 'EXCEPTION RAISED!'
hex(b'')                                                     -> 'EXCEPTION RAISED!'
hex(b'A')                                                    -> 'EXCEPTION RAISED!'
hex(b'ABBA')                                                 -> 'EXCEPTION RAISED!'
hex(bytearray(b''))                                          -> 'EXCEPTION RAISED!'
hex(bytearray(b'A'))                                         -> 'EXCEPTION RAISED!'
hex(bytearray(b'ABBA'))                                      -> 'EXCEPTION RAISED!'
hex(set())                                                   -> 'EXCEPTION RAISED!'
hex({1, 'two', (3+0j), (4, 5, 6)})                           -> 'EXCEPTION RAISED!'
hex(frozenset())                                             -> 'EXCEPTION RAISED!'
hex(frozenset({1, 'two', (3+0j), (4, 5, 6)}))                -> 'EXCEPTION RAISED!'
hex({})                                                      -> 'EXCEPTION RAISED!'
hex({1: 'one', 'two': (2+3j), ('RC', 3): None})              -> 'EXCEPTION RAISED!'
oct(0)                                                       -> '0o0'
oct(42)                                                      -> '0o52'
oct(0.0)                                                     -> 'EXCEPTION RAISED!'
oct(12.34)                                                   -> 'EXCEPTION RAISED!'
oct(56.0)                                                    -> 'EXCEPTION RAISED!'
oct(0j)                                                      -> 'EXCEPTION RAISED!'
oct((1+2j))                                                  -> 'EXCEPTION RAISED!'
oct((1+0j))                                                  -> 'EXCEPTION RAISED!'
oct((78.9+0j))                                               -> 'EXCEPTION RAISED!'
oct(1.2j)                                                    -> 'EXCEPTION RAISED!'
oct(Fraction(0, 1))                                          -> 'EXCEPTION RAISED!'
oct(Fraction(22, 7))                                         -> 'EXCEPTION RAISED!'
oct(Fraction(2, 1))                                          -> 'EXCEPTION RAISED!'
oct(Decimal('0'))                                            -> 'EXCEPTION RAISED!'
oct(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
oct(Decimal('1'))                                            -> 'EXCEPTION RAISED!'
oct(Decimal('1.5'))                                          -> 'EXCEPTION RAISED!'
oct(True)                                                    -> '0o1'
oct(False)                                                   -> '0o0'
oct()           -> 'EXCEPTION RAISED!'
oct()            -> 'EXCEPTION RAISED!'
oct()             -> 'EXCEPTION RAISED!'
oct()            -> 'EXCEPTION RAISED!'
oct()           -> 'EXCEPTION RAISED!'
oct([])                                                      -> 'EXCEPTION RAISED!'
oct([1, 2])                                                  -> 'EXCEPTION RAISED!'
oct([[1, 2], [3, 4]])                                        -> 'EXCEPTION RAISED!'
oct(())                                                      -> 'EXCEPTION RAISED!'
oct((1, 'two', (3+0j)))                                      -> 'EXCEPTION RAISED!'
oct((('a', 1), (2, 'b')))                                    -> 'EXCEPTION RAISED!'
oct(range(0, 0))                                             -> 'EXCEPTION RAISED!'
oct(range(0, 3))                                             -> 'EXCEPTION RAISED!'
oct('')                                                      -> 'EXCEPTION RAISED!'
oct('A')                                                     -> 'EXCEPTION RAISED!'
oct('ABBA')                                                  -> 'EXCEPTION RAISED!'
oct('Milü')                                                  -> 'EXCEPTION RAISED!'
oct(b'')                                                     -> 'EXCEPTION RAISED!'
oct(b'A')                                                    -> 'EXCEPTION RAISED!'
oct(b'ABBA')                                                 -> 'EXCEPTION RAISED!'
oct(bytearray(b''))                                          -> 'EXCEPTION RAISED!'
oct(bytearray(b'A'))                                         -> 'EXCEPTION RAISED!'
oct(bytearray(b'ABBA'))                                      -> 'EXCEPTION RAISED!'
oct(set())                                                   -> 'EXCEPTION RAISED!'
oct({1, 'two', (3+0j), (4, 5, 6)})                           -> 'EXCEPTION RAISED!'
oct(frozenset())                                             -> 'EXCEPTION RAISED!'
oct(frozenset({1, 'two', (3+0j), (4, 5, 6)}))                -> 'EXCEPTION RAISED!'
oct({})                                                      -> 'EXCEPTION RAISED!'
oct({1: 'one', 'two': (2+3j), ('RC', 3): None})              -> 'EXCEPTION RAISED!'
bin(0)                                                       -> '0b0'
bin(42)                                                      -> '0b101010'
bin(0.0)                                                     -> 'EXCEPTION RAISED!'
bin(12.34)                                                   -> 'EXCEPTION RAISED!'
bin(56.0)                                                    -> 'EXCEPTION RAISED!'
bin(0j)                                                      -> 'EXCEPTION RAISED!'
bin((1+2j))                                                  -> 'EXCEPTION RAISED!'
bin((1+0j))                                                  -> 'EXCEPTION RAISED!'
bin((78.9+0j))                                               -> 'EXCEPTION RAISED!'
bin(1.2j)                                                    -> 'EXCEPTION RAISED!'
bin(Fraction(0, 1))                                          -> 'EXCEPTION RAISED!'
bin(Fraction(22, 7))                                         -> 'EXCEPTION RAISED!'
bin(Fraction(2, 1))                                          -> 'EXCEPTION RAISED!'
bin(Decimal('0'))                                            -> 'EXCEPTION RAISED!'
bin(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
bin(Decimal('1'))                                            -> 'EXCEPTION RAISED!'
bin(Decimal('1.5'))                                          -> 'EXCEPTION RAISED!'
bin(True)                                                    -> '0b1'
bin(False)                                                   -> '0b0'
bin()           -> 'EXCEPTION RAISED!'
bin()            -> 'EXCEPTION RAISED!'
bin()             -> 'EXCEPTION RAISED!'
bin()            -> 'EXCEPTION RAISED!'
bin()           -> 'EXCEPTION RAISED!'
bin([])                                                      -> 'EXCEPTION RAISED!'
bin([1, 2])                                                  -> 'EXCEPTION RAISED!'
bin([[1, 2], [3, 4]])                                        -> 'EXCEPTION RAISED!'
bin(())                                                      -> 'EXCEPTION RAISED!'
bin((1, 'two', (3+0j)))                                      -> 'EXCEPTION RAISED!'
bin((('a', 1), (2, 'b')))                                    -> 'EXCEPTION RAISED!'
bin(range(0, 0))                                             -> 'EXCEPTION RAISED!'
bin(range(0, 3))                                             -> 'EXCEPTION RAISED!'
bin('')                                                      -> 'EXCEPTION RAISED!'
bin('A')                                                     -> 'EXCEPTION RAISED!'
bin('ABBA')                                                  -> 'EXCEPTION RAISED!'
bin('Milü')                                                  -> 'EXCEPTION RAISED!'
bin(b'')                                                     -> 'EXCEPTION RAISED!'
bin(b'A')                                                    -> 'EXCEPTION RAISED!'
bin(b'ABBA')                                                 -> 'EXCEPTION RAISED!'
bin(bytearray(b''))                                          -> 'EXCEPTION RAISED!'
bin(bytearray(b'A'))                                         -> 'EXCEPTION RAISED!'
bin(bytearray(b'ABBA'))                                      -> 'EXCEPTION RAISED!'
bin(set())                                                   -> 'EXCEPTION RAISED!'
bin({1, 'two', (3+0j), (4, 5, 6)})                           -> 'EXCEPTION RAISED!'
bin(frozenset())                                             -> 'EXCEPTION RAISED!'
bin(frozenset({1, 'two', (3+0j), (4, 5, 6)}))                -> 'EXCEPTION RAISED!'
bin({})                                                      -> 'EXCEPTION RAISED!'
bin({1: 'one', 'two': (2+3j), ('RC', 3): None})              -> 'EXCEPTION RAISED!'
bool(0)                                                      -> False
bool(42)                                                     -> True
bool(0.0)                                                    -> False
bool(12.34)                                                  -> True
bool(56.0)                                                   -> True
bool(0j)                                                     -> False
bool((1+2j))                                                 -> True
bool((1+0j))                                                 -> True
bool((78.9+0j))                                              -> True
bool(1.2j)                                                   -> True
bool(Fraction(0, 1))                                         -> False
bool(Fraction(22, 7))                                        -> True
bool(Fraction(2, 1))                                         -> True
bool(Decimal('0'))                                           -> False
bool(Decimal('3.14159265358979323846264338327950288419716939937510')) -> True
bool(Decimal('1'))                                           -> True
bool(Decimal('1.5'))                                         -> True
bool(True)                                                   -> True
bool(False)                                                  -> False
bool()          -> True
bool()           -> True
bool()            -> True
bool()           -> True
bool()          -> True
bool([])                                                     -> False
bool([1, 2])                                                 -> True
bool([[1, 2], [3, 4]])                                       -> True
bool(())                                                     -> False
bool((1, 'two', (3+0j)))                                     -> True
bool((('a', 1), (2, 'b')))                                   -> True
bool(range(0, 0))                                            -> False
bool(range(0, 3))                                            -> True
bool('')                                                     -> False
bool('A')                                                    -> True
bool('ABBA')                                                 -> True
bool('Milü')                                                 -> True
bool(b'')                                                    -> False
bool(b'A')                                                   -> True
bool(b'ABBA')                                                -> True
bool(bytearray(b''))                                         -> False
bool(bytearray(b'A'))                                        -> True
bool(bytearray(b'ABBA'))                                     -> True
bool(set())                                                  -> False
bool({1, 'two', (3+0j), (4, 5, 6)})                          -> True
bool(frozenset())                                            -> False
bool(frozenset({1, 'two', (3+0j), (4, 5, 6)}))               -> True
bool({})                                                     -> False
bool({1: 'one', 'two': (2+3j), ('RC', 3): None})             -> True
iter(0)                                                      -> 'EXCEPTION RAISED!'
iter(42)                                                     -> 'EXCEPTION RAISED!'
iter(0.0)                                                    -> 'EXCEPTION RAISED!'
iter(12.34)                                                  -> 'EXCEPTION RAISED!'
iter(56.0)                                                   -> 'EXCEPTION RAISED!'
iter(0j)                                                     -> 'EXCEPTION RAISED!'
iter((1+2j))                                                 -> 'EXCEPTION RAISED!'
iter((1+0j))                                                 -> 'EXCEPTION RAISED!'
iter((78.9+0j))                                              -> 'EXCEPTION RAISED!'
iter(1.2j)                                                   -> 'EXCEPTION RAISED!'
iter(Fraction(0, 1))                                         -> 'EXCEPTION RAISED!'
iter(Fraction(22, 7))                                        -> 'EXCEPTION RAISED!'
iter(Fraction(2, 1))                                         -> 'EXCEPTION RAISED!'
iter(Decimal('0'))                                           -> 'EXCEPTION RAISED!'
iter(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
iter(Decimal('1'))                                           -> 'EXCEPTION RAISED!'
iter(Decimal('1.5'))                                         -> 'EXCEPTION RAISED!'
iter(True)                                                   -> 'EXCEPTION RAISED!'
iter(False)                                                  -> 'EXCEPTION RAISED!'
iter()          -> 
iter()           -> 
iter()            -> 
iter()           -> 
iter()          -> 
iter([])                                                     -> 
iter([1, 2])                                                 -> 
iter([[1, 2], [3, 4]])                                       -> 
iter(())                                                     -> 
iter((1, 'two', (3+0j)))                                     -> 
iter((('a', 1), (2, 'b')))                                   -> 
iter(range(0, 0))                                            -> 
iter(range(0, 3))                                            -> 
iter('')                                                     -> 
iter('A')                                                    -> 
iter('ABBA')                                                 -> 
iter('Milü')                                                 -> 
iter(b'')                                                    -> 
iter(b'A')                                                   -> 
iter(b'ABBA')                                                -> 
iter(bytearray(b''))                                         -> 
iter(bytearray(b'A'))                                        -> 
iter(bytearray(b'ABBA'))                                     -> 
iter(set())                                                  -> 
iter({1, 'two', (3+0j), (4, 5, 6)})                          -> 
iter(frozenset())                                            -> 
iter(frozenset({1, 'two', (3+0j), (4, 5, 6)}))               -> 
iter({})                                                     -> 
iter({1: 'one', 'two': (2+3j), ('RC', 3): None})             -> 
list(0)                                                      -> 'EXCEPTION RAISED!'
list(42)                                                     -> 'EXCEPTION RAISED!'
list(0.0)                                                    -> 'EXCEPTION RAISED!'
list(12.34)                                                  -> 'EXCEPTION RAISED!'
list(56.0)                                                   -> 'EXCEPTION RAISED!'
list(0j)                                                     -> 'EXCEPTION RAISED!'
list((1+2j))                                                 -> 'EXCEPTION RAISED!'
list((1+0j))                                                 -> 'EXCEPTION RAISED!'
list((78.9+0j))                                              -> 'EXCEPTION RAISED!'
list(1.2j)                                                   -> 'EXCEPTION RAISED!'
list(Fraction(0, 1))                                         -> 'EXCEPTION RAISED!'
list(Fraction(22, 7))                                        -> 'EXCEPTION RAISED!'
list(Fraction(2, 1))                                         -> 'EXCEPTION RAISED!'
list(Decimal('0'))                                           -> 'EXCEPTION RAISED!'
list(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
list(Decimal('1'))                                           -> 'EXCEPTION RAISED!'
list(Decimal('1.5'))                                         -> 'EXCEPTION RAISED!'
list(True)                                                   -> 'EXCEPTION RAISED!'
list(False)                                                  -> 'EXCEPTION RAISED!'
list()          -> []
list()           -> [1, 2, 3]
list()            -> ['C', 'A', 'B']
list()           -> [[1, 2], [3, 4]]
list()          -> [('a', 1), (2, 'b')]
list([])                                                     -> []
list([1, 2])                                                 -> [1, 2]
list([[1, 2], [3, 4]])                                       -> [[1, 2], [3, 4]]
list(())                                                     -> []
list((1, 'two', (3+0j)))                                     -> [1, 'two', (3+0j)]
list((('a', 1), (2, 'b')))                                   -> [('a', 1), (2, 'b')]
list(range(0, 0))                                            -> []
list(range(0, 3))                                            -> [0, 1, 2]
list('')                                                     -> []
list('A')                                                    -> ['A']
list('ABBA')                                                 -> ['A', 'B', 'B', 'A']
list('Milü')                                                 -> ['M', 'i', 'l', 'ü']
list(b'')                                                    -> []
list(b'A')                                                   -> [65]
list(b'ABBA')                                                -> [65, 66, 66, 65]
list(bytearray(b''))                                         -> []
list(bytearray(b'A'))                                        -> [65]
list(bytearray(b'ABBA'))                                     -> [65, 66, 66, 65]
list(set())                                                  -> []
list({1, 'two', (3+0j), (4, 5, 6)})                          -> [1, 'two', (3+0j), (4, 5, 6)]
list(frozenset())                                            -> []
list(frozenset({1, 'two', (3+0j), (4, 5, 6)}))               -> [1, 'two', (3+0j), (4, 5, 6)]
list({})                                                     -> []
list({1: 'one', 'two': (2+3j), ('RC', 3): None})             -> [1, 'two', ('RC', 3)]
tuple(0)                                                     -> 'EXCEPTION RAISED!'
tuple(42)                                                    -> 'EXCEPTION RAISED!'
tuple(0.0)                                                   -> 'EXCEPTION RAISED!'
tuple(12.34)                                                 -> 'EXCEPTION RAISED!'
tuple(56.0)                                                  -> 'EXCEPTION RAISED!'
tuple(0j)                                                    -> 'EXCEPTION RAISED!'
tuple((1+2j))                                                -> 'EXCEPTION RAISED!'
tuple((1+0j))                                                -> 'EXCEPTION RAISED!'
tuple((78.9+0j))                                             -> 'EXCEPTION RAISED!'
tuple(1.2j)                                                  -> 'EXCEPTION RAISED!'
tuple(Fraction(0, 1))                                        -> 'EXCEPTION RAISED!'
tuple(Fraction(22, 7))                                       -> 'EXCEPTION RAISED!'
tuple(Fraction(2, 1))                                        -> 'EXCEPTION RAISED!'
tuple(Decimal('0'))                                          -> 'EXCEPTION RAISED!'
tuple(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
tuple(Decimal('1'))                                          -> 'EXCEPTION RAISED!'
tuple(Decimal('1.5'))                                        -> 'EXCEPTION RAISED!'
tuple(True)                                                  -> 'EXCEPTION RAISED!'
tuple(False)                                                 -> 'EXCEPTION RAISED!'
tuple()         -> ()
tuple()          -> ()
tuple()           -> ()
tuple()          -> ()
tuple()         -> ()
tuple([])                                                    -> ()
tuple([1, 2])                                                -> (1, 2)
tuple([[1, 2], [3, 4]])                                      -> ([1, 2], [3, 4])
tuple(())                                                    -> ()
tuple((1, 'two', (3+0j)))                                    -> (1, 'two', (3+0j))
tuple((('a', 1), (2, 'b')))                                  -> (('a', 1), (2, 'b'))
tuple(range(0, 0))                                           -> ()
tuple(range(0, 3))                                           -> (0, 1, 2)
tuple('')                                                    -> ()
tuple('A')                                                   -> ('A',)
tuple('ABBA')                                                -> ('A', 'B', 'B', 'A')
tuple('Milü')                                                -> ('M', 'i', 'l', 'ü')
tuple(b'')                                                   -> ()
tuple(b'A')                                                  -> (65,)
tuple(b'ABBA')                                               -> (65, 66, 66, 65)
tuple(bytearray(b''))                                        -> ()
tuple(bytearray(b'A'))                                       -> (65,)
tuple(bytearray(b'ABBA'))                                    -> (65, 66, 66, 65)
tuple(set())                                                 -> ()
tuple({1, 'two', (3+0j), (4, 5, 6)})                         -> (1, 'two', (3+0j), (4, 5, 6))
tuple(frozenset())                                           -> ()
tuple(frozenset({1, 'two', (3+0j), (4, 5, 6)}))              -> (1, 'two', (3+0j), (4, 5, 6))
tuple({})                                                    -> ()
tuple({1: 'one', 'two': (2+3j), ('RC', 3): None})            -> (1, 'two', ('RC', 3))
range(0)                                                     -> range(0, 0)
range(42)                                                    -> range(0, 42)
range(0.0)                                                   -> 'EXCEPTION RAISED!'
range(12.34)                                                 -> 'EXCEPTION RAISED!'
range(56.0)                                                  -> 'EXCEPTION RAISED!'
range(0j)                                                    -> 'EXCEPTION RAISED!'
range((1+2j))                                                -> 'EXCEPTION RAISED!'
range((1+0j))                                                -> 'EXCEPTION RAISED!'
range((78.9+0j))                                             -> 'EXCEPTION RAISED!'
range(1.2j)                                                  -> 'EXCEPTION RAISED!'
range(Fraction(0, 1))                                        -> 'EXCEPTION RAISED!'
range(Fraction(22, 7))                                       -> 'EXCEPTION RAISED!'
range(Fraction(2, 1))                                        -> 'EXCEPTION RAISED!'
range(Decimal('0'))                                          -> 'EXCEPTION RAISED!'
range(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
range(Decimal('1'))                                          -> 'EXCEPTION RAISED!'
range(Decimal('1.5'))                                        -> 'EXCEPTION RAISED!'
range(True)                                                  -> range(0, True)
range(False)                                                 -> range(0, False)
range()         -> 'EXCEPTION RAISED!'
range()          -> 'EXCEPTION RAISED!'
range()           -> 'EXCEPTION RAISED!'
range()          -> 'EXCEPTION RAISED!'
range()         -> 'EXCEPTION RAISED!'
range([])                                                    -> 'EXCEPTION RAISED!'
range([1, 2])                                                -> 'EXCEPTION RAISED!'
range([[1, 2], [3, 4]])                                      -> 'EXCEPTION RAISED!'
range(())                                                    -> 'EXCEPTION RAISED!'
range((1, 'two', (3+0j)))                                    -> 'EXCEPTION RAISED!'
range((('a', 1), (2, 'b')))                                  -> 'EXCEPTION RAISED!'
range(range(0, 0))                                           -> 'EXCEPTION RAISED!'
range(range(0, 3))                                           -> 'EXCEPTION RAISED!'
range('')                                                    -> 'EXCEPTION RAISED!'
range('A')                                                   -> 'EXCEPTION RAISED!'
range('ABBA')                                                -> 'EXCEPTION RAISED!'
range('Milü')                                                -> 'EXCEPTION RAISED!'
range(b'')                                                   -> 'EXCEPTION RAISED!'
range(b'A')                                                  -> 'EXCEPTION RAISED!'
range(b'ABBA')                                               -> 'EXCEPTION RAISED!'
range(bytearray(b''))                                        -> 'EXCEPTION RAISED!'
range(bytearray(b'A'))                                       -> 'EXCEPTION RAISED!'
range(bytearray(b'ABBA'))                                    -> 'EXCEPTION RAISED!'
range(set())                                                 -> 'EXCEPTION RAISED!'
range({1, 'two', (3+0j), (4, 5, 6)})                         -> 'EXCEPTION RAISED!'
range(frozenset())                                           -> 'EXCEPTION RAISED!'
range(frozenset({1, 'two', (3+0j), (4, 5, 6)}))              -> 'EXCEPTION RAISED!'
range({})                                                    -> 'EXCEPTION RAISED!'
range({1: 'one', 'two': (2+3j), ('RC', 3): None})            -> 'EXCEPTION RAISED!'
str(0)                                                       -> '0'
str(42)                                                      -> '42'
str(0.0)                                                     -> '0.0'
str(12.34)                                                   -> '12.34'
str(56.0)                                                    -> '56.0'
str(0j)                                                      -> '0j'
str((1+2j))                                                  -> '(1+2j)'
str((1+0j))                                                  -> '(1+0j)'
str((78.9+0j))                                               -> '(78.9+0j)'
str(1.2j)                                                    -> '1.2j'
str(Fraction(0, 1))                                          -> '0'
str(Fraction(22, 7))                                         -> '22/7'
str(Fraction(2, 1))                                          -> '2'
str(Decimal('0'))                                            -> '0'
str(Decimal('3.14159265358979323846264338327950288419716939937510')) -> '3.14159265358979323846264338327950288419716939937510'
str(Decimal('1'))                                            -> '1'
str(Decimal('1.5'))                                          -> '1.5'
str(True)                                                    -> 'True'
str(False)                                                   -> 'False'
str()           -> ''
str()            -> ''
str()             -> ''
str()            -> ''
str()           -> ''
str([])                                                      -> '[]'
str([1, 2])                                                  -> '[1, 2]'
str([[1, 2], [3, 4]])                                        -> '[[1, 2], [3, 4]]'
str(())                                                      -> '()'
str((1, 'two', (3+0j)))                                      -> "(1, 'two', (3+0j))"
str((('a', 1), (2, 'b')))                                    -> "(('a', 1), (2, 'b'))"
str(range(0, 0))                                             -> 'range(0, 0)'
str(range(0, 3))                                             -> 'range(0, 3)'
str('')                                                      -> ''
str('A')                                                     -> 'A'
str('ABBA')                                                  -> 'ABBA'
str('Milü')                                                  -> 'Milü'
str(b'')                                                     -> "b''"
str(b'A')                                                    -> "b'A'"
str(b'ABBA')                                                 -> "b'ABBA'"
str(bytearray(b''))                                          -> "bytearray(b'')"
str(bytearray(b'A'))                                         -> "bytearray(b'A')"
str(bytearray(b'ABBA'))                                      -> "bytearray(b'ABBA')"
str(set())                                                   -> 'set()'
str({1, 'two', (3+0j), (4, 5, 6)})                           -> "{1, 'two', (3+0j), (4, 5, 6)}"
str(frozenset())                                             -> 'frozenset()'
str(frozenset({1, 'two', (3+0j), (4, 5, 6)}))                -> "frozenset({1, 'two', (3+0j), (4, 5, 6)})"
str({})                                                      -> '{}'
str({1: 'one', 'two': (2+3j), ('RC', 3): None})              -> "{1: 'one', 'two': (2+3j), ('RC', 3): None}"
bytes(0)                                                     -> b''
bytes(42)                                                    -> b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
bytes(0.0)                                                   -> 'EXCEPTION RAISED!'
bytes(12.34)                                                 -> 'EXCEPTION RAISED!'
bytes(56.0)                                                  -> 'EXCEPTION RAISED!'
bytes(0j)                                                    -> 'EXCEPTION RAISED!'
bytes((1+2j))                                                -> 'EXCEPTION RAISED!'
bytes((1+0j))                                                -> 'EXCEPTION RAISED!'
bytes((78.9+0j))                                             -> 'EXCEPTION RAISED!'
bytes(1.2j)                                                  -> 'EXCEPTION RAISED!'
bytes(Fraction(0, 1))                                        -> 'EXCEPTION RAISED!'
bytes(Fraction(22, 7))                                       -> 'EXCEPTION RAISED!'
bytes(Fraction(2, 1))                                        -> 'EXCEPTION RAISED!'
bytes(Decimal('0'))                                          -> 'EXCEPTION RAISED!'
bytes(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
bytes(Decimal('1'))                                          -> 'EXCEPTION RAISED!'
bytes(Decimal('1.5'))                                        -> 'EXCEPTION RAISED!'
bytes(True)                                                  -> b'\x00'
bytes(False)                                                 -> b''
bytes()         -> b''
bytes()          -> b''
bytes()           -> b''
bytes()          -> b''
bytes()         -> b''
bytes([])                                                    -> b''
bytes([1, 2])                                                -> b'\x01\x02'
bytes([[1, 2], [3, 4]])                                      -> 'EXCEPTION RAISED!'
bytes(())                                                    -> b''
bytes((1, 'two', (3+0j)))                                    -> 'EXCEPTION RAISED!'
bytes((('a', 1), (2, 'b')))                                  -> 'EXCEPTION RAISED!'
bytes(range(0, 0))                                           -> b''
bytes(range(0, 3))                                           -> b'\x00\x01\x02'
bytes('')                                                    -> 'EXCEPTION RAISED!'
bytes('A')                                                   -> 'EXCEPTION RAISED!'
bytes('ABBA')                                                -> 'EXCEPTION RAISED!'
bytes('Milü')                                                -> 'EXCEPTION RAISED!'
bytes(b'')                                                   -> b''
bytes(b'A')                                                  -> b'A'
bytes(b'ABBA')                                               -> b'ABBA'
bytes(bytearray(b''))                                        -> b''
bytes(bytearray(b'A'))                                       -> b'A'
bytes(bytearray(b'ABBA'))                                    -> b'ABBA'
bytes(set())                                                 -> b''
bytes({1, 'two', (3+0j), (4, 5, 6)})                         -> 'EXCEPTION RAISED!'
bytes(frozenset())                                           -> b''
bytes(frozenset({1, 'two', (3+0j), (4, 5, 6)}))              -> 'EXCEPTION RAISED!'
bytes({})                                                    -> b''
bytes({1: 'one', 'two': (2+3j), ('RC', 3): None})            -> 'EXCEPTION RAISED!'
bytearray(0)                                                 -> bytearray(b'')
bytearray(42)                                                -> bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(0.0)                                               -> 'EXCEPTION RAISED!'
bytearray(12.34)                                             -> 'EXCEPTION RAISED!'
bytearray(56.0)                                              -> 'EXCEPTION RAISED!'
bytearray(0j)                                                -> 'EXCEPTION RAISED!'
bytearray((1+2j))                                            -> 'EXCEPTION RAISED!'
bytearray((1+0j))                                            -> 'EXCEPTION RAISED!'
bytearray((78.9+0j))                                         -> 'EXCEPTION RAISED!'
bytearray(1.2j)                                              -> 'EXCEPTION RAISED!'
bytearray(Fraction(0, 1))                                    -> 'EXCEPTION RAISED!'
bytearray(Fraction(22, 7))                                   -> 'EXCEPTION RAISED!'
bytearray(Fraction(2, 1))                                    -> 'EXCEPTION RAISED!'
bytearray(Decimal('0'))                                      -> 'EXCEPTION RAISED!'
bytearray(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
bytearray(Decimal('1'))                                      -> 'EXCEPTION RAISED!'
bytearray(Decimal('1.5'))                                    -> 'EXCEPTION RAISED!'
bytearray(True)                                              -> bytearray(b'\x00')
bytearray(False)                                             -> bytearray(b'')
bytearray()     -> bytearray(b'')
bytearray()      -> bytearray(b'')
bytearray()       -> bytearray(b'')
bytearray()      -> bytearray(b'')
bytearray()     -> bytearray(b'')
bytearray([])                                                -> bytearray(b'')
bytearray([1, 2])                                            -> bytearray(b'\x01\x02')
bytearray([[1, 2], [3, 4]])                                  -> 'EXCEPTION RAISED!'
bytearray(())                                                -> bytearray(b'')
bytearray((1, 'two', (3+0j)))                                -> 'EXCEPTION RAISED!'
bytearray((('a', 1), (2, 'b')))                              -> 'EXCEPTION RAISED!'
bytearray(range(0, 0))                                       -> bytearray(b'')
bytearray(range(0, 3))                                       -> bytearray(b'\x00\x01\x02')
bytearray('')                                                -> 'EXCEPTION RAISED!'
bytearray('A')                                               -> 'EXCEPTION RAISED!'
bytearray('ABBA')                                            -> 'EXCEPTION RAISED!'
bytearray('Milü')                                            -> 'EXCEPTION RAISED!'
bytearray(b'')                                               -> bytearray(b'')
bytearray(b'A')                                              -> bytearray(b'A')
bytearray(b'ABBA')                                           -> bytearray(b'ABBA')
bytearray(bytearray(b''))                                    -> bytearray(b'')
bytearray(bytearray(b'A'))                                   -> bytearray(b'A')
bytearray(bytearray(b'ABBA'))                                -> bytearray(b'ABBA')
bytearray(set())                                             -> bytearray(b'')
bytearray({1, 'two', (3+0j), (4, 5, 6)})                     -> 'EXCEPTION RAISED!'
bytearray(frozenset())                                       -> bytearray(b'')
bytearray(frozenset({1, 'two', (3+0j), (4, 5, 6)}))          -> 'EXCEPTION RAISED!'
bytearray({})                                                -> bytearray(b'')
bytearray({1: 'one', 'two': (2+3j), ('RC', 3): None})        -> 'EXCEPTION RAISED!'
set(0)                                                       -> 'EXCEPTION RAISED!'
set(42)                                                      -> 'EXCEPTION RAISED!'
set(0.0)                                                     -> 'EXCEPTION RAISED!'
set(12.34)                                                   -> 'EXCEPTION RAISED!'
set(56.0)                                                    -> 'EXCEPTION RAISED!'
set(0j)                                                      -> 'EXCEPTION RAISED!'
set((1+2j))                                                  -> 'EXCEPTION RAISED!'
set((1+0j))                                                  -> 'EXCEPTION RAISED!'
set((78.9+0j))                                               -> 'EXCEPTION RAISED!'
set(1.2j)                                                    -> 'EXCEPTION RAISED!'
set(Fraction(0, 1))                                          -> 'EXCEPTION RAISED!'
set(Fraction(22, 7))                                         -> 'EXCEPTION RAISED!'
set(Fraction(2, 1))                                          -> 'EXCEPTION RAISED!'
set(Decimal('0'))                                            -> 'EXCEPTION RAISED!'
set(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
set(Decimal('1'))                                            -> 'EXCEPTION RAISED!'
set(Decimal('1.5'))                                          -> 'EXCEPTION RAISED!'
set(True)                                                    -> 'EXCEPTION RAISED!'
set(False)                                                   -> 'EXCEPTION RAISED!'
set()           -> set()
set()            -> set()
set()             -> set()
set()            -> set()
set()           -> set()
set([])                                                      -> set()
set([1, 2])                                                  -> {1, 2}
set([[1, 2], [3, 4]])                                        -> 'EXCEPTION RAISED!'
set(())                                                      -> set()
set((1, 'two', (3+0j)))                                      -> {1, 'two', (3+0j)}
set((('a', 1), (2, 'b')))                                    -> {(2, 'b'), ('a', 1)}
set(range(0, 0))                                             -> set()
set(range(0, 3))                                             -> {0, 1, 2}
set('')                                                      -> set()
set('A')                                                     -> {'A'}
set('ABBA')                                                  -> {'A', 'B'}
set('Milü')                                                  -> {'M', 'i', 'ü', 'l'}
set(b'')                                                     -> set()
set(b'A')                                                    -> {65}
set(b'ABBA')                                                 -> {65, 66}
set(bytearray(b''))                                          -> set()
set(bytearray(b'A'))                                         -> {65}
set(bytearray(b'ABBA'))                                      -> {65, 66}
set(set())                                                   -> set()
set({1, 'two', (3+0j), (4, 5, 6)})                           -> {1, 'two', (3+0j), (4, 5, 6)}
set(frozenset())                                             -> set()
set(frozenset({1, 'two', (3+0j), (4, 5, 6)}))                -> {1, 'two', (3+0j), (4, 5, 6)}
set({})                                                      -> set()
set({1: 'one', 'two': (2+3j), ('RC', 3): None})              -> {1, 'two', ('RC', 3)}
frozenset(0)                                                 -> 'EXCEPTION RAISED!'
frozenset(42)                                                -> 'EXCEPTION RAISED!'
frozenset(0.0)                                               -> 'EXCEPTION RAISED!'
frozenset(12.34)                                             -> 'EXCEPTION RAISED!'
frozenset(56.0)                                              -> 'EXCEPTION RAISED!'
frozenset(0j)                                                -> 'EXCEPTION RAISED!'
frozenset((1+2j))                                            -> 'EXCEPTION RAISED!'
frozenset((1+0j))                                            -> 'EXCEPTION RAISED!'
frozenset((78.9+0j))                                         -> 'EXCEPTION RAISED!'
frozenset(1.2j)                                              -> 'EXCEPTION RAISED!'
frozenset(Fraction(0, 1))                                    -> 'EXCEPTION RAISED!'
frozenset(Fraction(22, 7))                                   -> 'EXCEPTION RAISED!'
frozenset(Fraction(2, 1))                                    -> 'EXCEPTION RAISED!'
frozenset(Decimal('0'))                                      -> 'EXCEPTION RAISED!'
frozenset(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
frozenset(Decimal('1'))                                      -> 'EXCEPTION RAISED!'
frozenset(Decimal('1.5'))                                    -> 'EXCEPTION RAISED!'
frozenset(True)                                              -> 'EXCEPTION RAISED!'
frozenset(False)                                             -> 'EXCEPTION RAISED!'
frozenset()     -> frozenset()
frozenset()      -> frozenset()
frozenset()       -> frozenset()
frozenset()      -> frozenset()
frozenset()     -> frozenset()
frozenset([])                                                -> frozenset()
frozenset([1, 2])                                            -> frozenset({1, 2})
frozenset([[1, 2], [3, 4]])                                  -> 'EXCEPTION RAISED!'
frozenset(())                                                -> frozenset()
frozenset((1, 'two', (3+0j)))                                -> frozenset({1, 'two', (3+0j)})
frozenset((('a', 1), (2, 'b')))                              -> frozenset({(2, 'b'), ('a', 1)})
frozenset(range(0, 0))                                       -> frozenset()
frozenset(range(0, 3))                                       -> frozenset({0, 1, 2})
frozenset('')                                                -> frozenset()
frozenset('A')                                               -> frozenset({'A'})
frozenset('ABBA')                                            -> frozenset({'A', 'B'})
frozenset('Milü')                                            -> frozenset({'M', 'i', 'ü', 'l'})
frozenset(b'')                                               -> frozenset()
frozenset(b'A')                                              -> frozenset({65})
frozenset(b'ABBA')                                           -> frozenset({65, 66})
frozenset(bytearray(b''))                                    -> frozenset()
frozenset(bytearray(b'A'))                                   -> frozenset({65})
frozenset(bytearray(b'ABBA'))                                -> frozenset({65, 66})
frozenset(set())                                             -> frozenset()
frozenset({1, 'two', (3+0j), (4, 5, 6)})                     -> frozenset({1, 'two', (3+0j), (4, 5, 6)})
frozenset(frozenset())                                       -> frozenset()
frozenset(frozenset({1, 'two', (3+0j), (4, 5, 6)}))          -> frozenset({1, 'two', (3+0j), (4, 5, 6)})
frozenset({})                                                -> frozenset()
frozenset({1: 'one', 'two': (2+3j), ('RC', 3): None})        -> frozenset({1, 'two', ('RC', 3)})
dict(0)                                                      -> 'EXCEPTION RAISED!'
dict(42)                                                     -> 'EXCEPTION RAISED!'
dict(0.0)                                                    -> 'EXCEPTION RAISED!'
dict(12.34)                                                  -> 'EXCEPTION RAISED!'
dict(56.0)                                                   -> 'EXCEPTION RAISED!'
dict(0j)                                                     -> 'EXCEPTION RAISED!'
dict((1+2j))                                                 -> 'EXCEPTION RAISED!'
dict((1+0j))                                                 -> 'EXCEPTION RAISED!'
dict((78.9+0j))                                              -> 'EXCEPTION RAISED!'
dict(1.2j)                                                   -> 'EXCEPTION RAISED!'
dict(Fraction(0, 1))                                         -> 'EXCEPTION RAISED!'
dict(Fraction(22, 7))                                        -> 'EXCEPTION RAISED!'
dict(Fraction(2, 1))                                         -> 'EXCEPTION RAISED!'
dict(Decimal('0'))                                           -> 'EXCEPTION RAISED!'
dict(Decimal('3.14159265358979323846264338327950288419716939937510')) -> 'EXCEPTION RAISED!'
dict(Decimal('1'))                                           -> 'EXCEPTION RAISED!'
dict(Decimal('1.5'))                                         -> 'EXCEPTION RAISED!'
dict(True)                                                   -> 'EXCEPTION RAISED!'
dict(False)                                                  -> 'EXCEPTION RAISED!'
dict()          -> {}
dict()           -> {}
dict()            -> {}
dict()           -> {}
dict()          -> {}
dict([])                                                     -> {}
dict([1, 2])                                                 -> 'EXCEPTION RAISED!'
dict([[1, 2], [3, 4]])                                       -> {1: 2, 3: 4}
dict(())                                                     -> {}
dict((1, 'two', (3+0j)))                                     -> 'EXCEPTION RAISED!'
dict((('a', 1), (2, 'b')))                                   -> {'a': 1, 2: 'b'}
dict(range(0, 0))                                            -> {}
dict(range(0, 3))                                            -> 'EXCEPTION RAISED!'
dict('')                                                     -> {}
dict('A')                                                    -> 'EXCEPTION RAISED!'
dict('ABBA')                                                 -> 'EXCEPTION RAISED!'
dict('Milü')                                                 -> 'EXCEPTION RAISED!'
dict(b'')                                                    -> {}
dict(b'A')                                                   -> 'EXCEPTION RAISED!'
dict(b'ABBA')                                                -> 'EXCEPTION RAISED!'
dict(bytearray(b''))                                         -> {}
dict(bytearray(b'A'))                                        -> 'EXCEPTION RAISED!'
dict(bytearray(b'ABBA'))                                     -> 'EXCEPTION RAISED!'
dict(set())                                                  -> {}
dict({1, 'two', (3+0j), (4, 5, 6)})                          -> 'EXCEPTION RAISED!'
dict(frozenset())                                            -> {}
dict(frozenset({1, 'two', (3+0j), (4, 5, 6)}))               -> 'EXCEPTION RAISED!'
dict({})                                                     -> {}
dict({1: 'one', 'two': (2+3j), ('RC', 3): None})             -> {1: 'one', 'two': (2+3j), ('RC', 3): None}