objprint
objprint copied to clipboard
A library that can print Python objects in human readable format
Now `op()` returns the object it prints to make calling chain possible. But in repl, that will print two instances. We should fix that for a better user experience.
我在使用 pydantic + objprint,打印对象使用了 #52 中的方法,但程序在 `op` 处阻塞住。 ```python from objprint import op from pydantic import BaseModel class A(BaseModel): a: int obj = A(a=1) op(obj, honor_existing=False) ```
op(an error class) prints nothing. > > > print(op(Exception())) > > > op(Exception()) Exception()
I use `objpring` to print the elf header object, hope the number can be displayed in hexadecimal.
我不确定这是不是个普遍的场景,还是算作特殊的需求。如下面的代码所示,我想用 objprint 来打印 Struct 类型的变量。但是因为 dataclass 已经有了 \_\_str\_\_ 的实现,我只能把 honor_existing 参数设为 False。可是这样 pathlib.Path 中 parent 属性会让 objprint 在输出时陷入无限递归,直到 depth。然而实际上我不需要对 pathlib.Path 的 honor_existing 设为 False。 ```python from dataclasses import dataclass from...
# Feature request We can use `op` or `objprint`'s option `depth` to control the time spend in printing.But, if we don't know the suitable depth, or even we don't know...
```python from objprint import op def func(): return 1 cc = op(func(), arg_name=True) ```  maybe it's because here: https://github.com/gaogaotiantian/objprint/blob/7920c8601e86e97fe05a807d820121bac00471b7/src/objprint/frame_analyzer.py#L55-L58 module is None for Jupyter & IPython, but they have...
When I'm referencing the project structure, it is found that `executing/__init__.py` has already imported `Source` and included in `__all__`, so is it more reasonable to change `frame_analyzer.py` line 10 `from...
Add typing hints (mypy strict mode)
When adding add_objprint to a class, it severely interferes with the (pylance) type checker.