[Python-Dev] from tuples to immutable dicts (original) (raw)
Brett Cannon bac@OCF.Berkeley.EDU
Sat, 23 Nov 2002 16:55:44 -0800 (PST)
- Previous message: [Python-Dev] from tuples to immutable dicts
- Next message: [Python-Dev] from tuples to immutable dicts
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Martin v. Loewis]
Fred once had a plan to expose structseqs to Python, to allow the creation of new structs in Python. I was suggesting that there should be a method new.structseq, which is called as
structseq(name, doc, ninsequence, (fields)) where fields is a list of (name,doc) tuples. The resulting thing would be similar to os.statresult: you need to call it with the mandatory ^^^^^^^ You meant "can", right, Martin?
fields in sequence, and can call it with the optional fields by keyword argument.
I think the idea is good if you can get it to tie directly into C code. That would get a +1 from me. If not, then +0. Kind of strikes me like a poor man's object with getitem written to call the object's attributes assigned a numeric name. Or can be viewed as a tuple with attribute names for each index.
If my Perl memory is not too rusty then I think this would be like Perl's arrays which might help get more people over from Perl (if we really want that =).
-Brett
- Previous message: [Python-Dev] from tuples to immutable dicts
- Next message: [Python-Dev] from tuples to immutable dicts
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]