MCPcopy Index your code
hub / github.com/go-python/gopy / isPyCompatVar

Function isPyCompatVar

bind/symbols.go:99–113  ·  view source on GitHub ↗

isPyCompatVar checks if var is compatible with python

(v *symbol)

Source from the content-addressed store, hash-verified

97
98// isPyCompatVar checks if var is compatible with python
99func isPyCompatVar(v *symbol) error {
100 if v == nil {
101 return fmt.Errorf("gopy: var symbol not found")
102 }
103 if v.isPointer() && v.isBasic() {
104 return fmt.Errorf("gopy: var is pointer to basic type")
105 }
106 if isErrorType(v.gotyp) {
107 return fmt.Errorf("gopy: var is error type")
108 }
109 if _, isChan := v.gotyp.(*types.Chan); isChan {
110 return fmt.Errorf("gopy: var is channel type")
111 }
112 return nil
113}
114
115// isPyCompatType checks if type is compatible with python
116func isPyCompatType(typ types.Type) error {

Callers 3

genConstMethod · 0.85
genVarMethod · 0.85
isPyCompatFieldFunction · 0.85

Calls 3

isErrorTypeFunction · 0.85
isPointerMethod · 0.80
isBasicMethod · 0.80

Tested by

no test coverage detected