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

Function newConst

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

Source from the content-addressed store, hash-verified

469}
470
471func newConst(p *Package, o *types.Const) (*Const, error) {
472 pkg := o.Pkg()
473 sym := p.syms.symtype(o.Type())
474 id := pkg.Name() + "_" + o.Name()
475 doc := p.getDoc("", o)
476 val := o.Val().String()
477
478 return &Const{
479 pkg: p,
480 sym: sym,
481 obj: o,
482 id: id,
483 doc: doc,
484 val: val,
485 }, nil
486}
487
488func (c *Const) ID() string { return c.id }
489func (c *Const) Doc() string { return c.doc }

Callers 2

addConstMethod · 0.85
AddConstMethod · 0.85

Calls 4

symtypeMethod · 0.80
getDocMethod · 0.80
NameMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected