async_property
async_property copied to clipboard
TypeError in iPython
- async_property version: 0.2.1
- Python version: 3.8.1
- Operating System: OS X 10.14.6
- iPython version: 7.11.1
Description
Trying to test the output of a cached attribute from the code example results in a TypeError in the iPython interpreter.
What I Did
In [53]: type(instance.value)
Out[53]: ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~/Documents/Code/…/virtualenv/lib/python3.8/site-packages/IPython/core/formatters.py in __call__(self, obj)
700 type_pprinters=self.type_printers,
701 deferred_pprinters=self.deferred_printers)
--> 702 printer.pretty(obj)
703 printer.flush()
704 return stream.getvalue()
~/Documents/Code/…/virtualenv/lib/python3.8/site-packages/IPython/lib/pretty.py in pretty(self, obj)
380 if cls in self.type_pprinters:
381 # printer registered in self.type_pprinters
--> 382 return self.type_pprinters[cls](obj, self, cycle)
383 else:
384 # deferred printer
~/Documents/Code/…/virtualenv/lib/python3.8/site-packages/IPython/lib/pretty.py in _type_pprint(obj, p, cycle)
681 p.text(name)
682 else:
--> 683 p.text(mod + '.' + name)
684
685
TypeError: unsupported operand type(s) for +: 'property' and 'str'
Still having this issue with Python 3.12.2. What's the best way to check if an AwaitableOnly has been initialized? Using something simple like if not instance.value: … doesn't seem to work.