Def __new__ (CLS, array, name="no name") :
Obj=np. Asarray (array). The view (CLS)
Obj. Name=name
Return obj
Def __array_finalize__ (self, obj) :
If obj is None: return
The self. The info=getattr (obj, 'name', "no name")
Z=NamedArray (np) arange (10), "range_10")
Print (Z.n ame)
CLS represent what meaning? Here, please?
CodePudding user response:
As if said the class itself, is a class method of writing