MCPcopy Create free account
hub / github.com/go-python/gopy / pySafeName

Function pySafeName

bind/symbols.go:83–88  ·  view source on GitHub ↗

pySafeName returns a name that python will not barf on

(nm string)

Source from the content-addressed store, hash-verified

81
82// pySafeName returns a name that python will not barf on
83func pySafeName(nm string) string {
84 if _, bad := pyKeywords[nm]; bad {
85 return "my" + nm
86 }
87 return nm
88}
89
90// pySafeArg returns an arg name that python will not barf on
91func pySafeArg(anm string, idx int) string {

Callers 1

pySafeArgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected