On Tuesday, March 30, 2004 12:31:35 AM UTC-7, Mark Hahn wrote: > > --Take advantage of iterators early on for return values to avoid > > things like having both dict.items() and dict.iteritems(). > > Interestiong idea. Generators are fully supported so I could do this now. > So gens would have to be allowed absolutely everywhere lists are allowed (is > trhis possible?). Or are you thinking the user should type > List(dict.items()) ?
No, the former. Most of the time you never really use a full, naked list anyway, generally only for documentation purposes. > > --Choose "{:}" syntax for empty dict creation to reserve "{}" for > > sets. (Or: use "{}" for both, and do automatic "set-to-dict > > Also cool. Maybe <> for sets? Prothon doesn't support <> as != so it is > free. I strongly suggest the standard (in math anyway) syntax for set notation. It shouldn't be hard to parse whether code syntax is referring to a set vs. dict. > > --Functions that return multiple, but unique, values should return a > > set, not a list, to communicate same (ex: dict.keys(), dir(), etc.). > > Also cool. This is something that still hasn't really been implemented in PythonV3. > > --Dict should inherit from Set. > > Also cool (I feel like the credits of Holy Grail saying Also wik). An alternative is to create a named association type, similar to the ABC programming language, denoted by the colon. "name": []. A dict then would simply be a set of these. Having a compound type would come in handy in several other ways too. > > --With prothon's "immutability" bit and other considerations, does the > > language need both tuples AND lists? > > I like this a lot. Tuples are already implemented internally as lists. I think, in fact, that the object model could be more unified. Under such a new object model, the worries about having a full library becomes rather pointless, as the new model will require a revamping of everything. > More like a few dollars. This is really good stuff. Can I talk you into > hanging out on the Prothon list now and then, at least until we get the core > language sorted out? Haha, a little late, but consider this a restart. -- http://mail.python.org/mailman/listinfo/python-list