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

Function newEnum

bind/types.go:506–523  ·  view source on GitHub ↗
(p *Package, o *types.Const)

Source from the content-addressed store, hash-verified

504}
505
506func newEnum(p *Package, o *types.Const) (*Enum, error) {
507 pkg := o.Pkg()
508 sym := p.syms.symtype(o.Type())
509 id := pkg.Name() + "_" + o.Name()
510 typ := o.Type().(*types.Named)
511 doc := p.getDoc("", typ.Obj())
512
513 e := &Enum{
514 pkg: p,
515 sym: sym,
516 obj: o,
517 typ: typ,
518 id: id,
519 doc: doc,
520 }
521 e.AddConst(p, o)
522 return e, nil
523}
524
525func (e *Enum) ID() string { return e.id }
526func (e *Enum) Doc() string { return e.doc }

Callers 1

addConstMethod · 0.85

Calls 5

AddConstMethod · 0.95
symtypeMethod · 0.80
getDocMethod · 0.80
NameMethod · 0.45
ObjMethod · 0.45

Tested by

no test coverage detected