Skip to content

Commit ac76658

Browse files
committed
Notes on attributes of built in objects
1 parent 7619a72 commit ac76658

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

notes.txt

+19-1
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,23 @@ BoundMethods should be run straight away in the vm not make a new vm
7575
ObjectType in *Type is probably redundant
7676
- except that Base can be nil
7777

78+
Attributes of built in types
79+
============================
7880

79-
81+
Use introspection to find methods of built in types and to find attributes
82+
83+
When the built in type is created with TypeNew fill up the type Dict
84+
with the methods and data descriptors (which implement __get__
85+
and __set__ as appropriate)
86+
87+
Introspect attributes by looking for `py:"args"` in the structure
88+
type. If it is writable it has a ",w" flag `py:"args,w"` - we'll use
89+
the type of the structure member to convert the incoming arg, so if it
90+
is a Tuple() we'll call MakeTuple() on it, etc. The attribute can
91+
also have help on it, eg `py:"__cause__,r,exception cause"`
92+
93+
Introspect methods by looking at all public methods
94+
95+
Transform the names, so that initial "M__" becomes "__" then lowercase
96+
the method. Only if the method matches one of the defined function types will it be exported.
97+
FIXME meta data for help would be nice? How attache metadata to go function?

0 commit comments

Comments
 (0)