mendevi.database.meta.extract_names

mendevi.database.meta.extract_names(expr: str) set[str][source]

Return all the symbols in the python expression.

Examples

>>> from mendevi.database.meta import extract_names
>>> extract_names("foo")
{'foo'}
>>> extract_names("[i**2 for i in foo]")
{'foo'}
>>> extract_names("foo.bar")
{'foo'}
>>> extract_names("bar(foo)")
{'foo'}
>>> extract_names("foo.bar()")
{'foo'}
>>>