Returns a string of the value's type with an indefinite article. For example 'an Image' or 'a PlotValue'.
(value: Any)
| 132 | |
| 133 | |
| 134 | def class_of(value: Any) -> Any: |
| 135 | """Returns a string of the value's type with an indefinite article. |
| 136 | |
| 137 | For example 'an Image' or 'a PlotValue'. |
| 138 | """ |
| 139 | if inspect.isclass(value): |
| 140 | return add_article(value.__name__) |
| 141 | else: |
| 142 | return class_of(type(value)) |
| 143 | |
| 144 | |
| 145 | def add_article(name: str, definite: bool = False, capital: bool = False) -> str: |
no test coverage detected
searching dependent graphs…