MCPcopy Create free account
hub / github.com/numpy/numpy / fromstring

Function fromstring

numpy/f2py/symbolic.py:1271–1280  ·  view source on GitHub ↗

Create an expression from a string. This is a "lazy" parser, that is, only arithmetic operations are resolved, non-arithmetic operations are treated as symbols.

(s, language=Language.C)

Source from the content-addressed store, hash-verified

1269
1270
1271def fromstring(s, language=Language.C):
1272 """Create an expression from a string.
1273
1274 This is a "lazy" parser, that is, only arithmetic operations are
1275 resolved, non-arithmetic operations are treated as symbols.
1276 """
1277 r = _FromStringWorker(language=language).parse(s)
1278 if isinstance(r, Expr):
1279 return r
1280 raise ValueError(f'failed to parse `{s}` to Expr instance: got `{r}`')
1281
1282
1283class _Pair:

Callers 2

test_fromstringMethod · 0.90
parseMethod · 0.70

Calls 2

_FromStringWorkerClass · 0.85
parseMethod · 0.45

Tested by 1

test_fromstringMethod · 0.72