(obj)
| 140 | if not legacy: |
| 141 | |
| 142 | def go(obj): |
| 143 | if uncertain: |
| 144 | try: |
| 145 | return hash(obj) |
| 146 | except: |
| 147 | pass |
| 148 | |
| 149 | raise sa_exc.InvalidRequestError( |
| 150 | "Can't apply uniqueness to row tuple containing value of " |
| 151 | f"""type {datatype!r}; { |
| 152 | 'the values returned appear to be' |
| 153 | if uncertain |
| 154 | else 'this datatype produces' |
| 155 | } non-hashable values""" |
| 156 | ) |
| 157 | |
| 158 | return go |
| 159 | elif not uncertain: |