Attempt to evaluate promise, even if obj is not a promise.
(obj)
| 350 | |
| 351 | |
| 352 | def maybe_evaluate(obj): |
| 353 | """Attempt to evaluate promise, even if obj is not a promise.""" |
| 354 | try: |
| 355 | return obj.__maybe_evaluate__() |
| 356 | except AttributeError: |
| 357 | return obj |
| 358 | |
| 359 | |
| 360 | # ############# Module Generation ########################## |