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

Function setattrspec

numpy/f2py/crackfortran.py:1920–1944  ·  view source on GitHub ↗
(decl, attr, force=0)

Source from the content-addressed store, hash-verified

1918
1919
1920def setattrspec(decl, attr, force=0):
1921 if not decl:
1922 decl = {}
1923 if not attr:
1924 return decl
1925 if 'attrspec' not in decl:
1926 decl['attrspec'] = [attr]
1927 return decl
1928 if force:
1929 decl['attrspec'].append(attr)
1930 if attr in decl['attrspec']:
1931 return decl
1932 if attr == 'static' and 'automatic' not in decl['attrspec']:
1933 decl['attrspec'].append(attr)
1934 elif attr == 'automatic' and 'static' not in decl['attrspec']:
1935 decl['attrspec'].append(attr)
1936 elif attr == 'public':
1937 if 'private' not in decl['attrspec']:
1938 decl['attrspec'].append(attr)
1939 elif attr == 'private':
1940 if 'public' not in decl['attrspec']:
1941 decl['attrspec'].append(attr)
1942 else:
1943 decl['attrspec'].append(attr)
1944 return decl
1945
1946
1947def setkindselector(decl, sel, force=0):

Callers 3

appenddeclFunction · 0.85
analyzevarsFunction · 0.85
expr2nameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected