crazy programming language thoughts

Fahd Khan speakstofish at hotmail.com
Tue Aug 26 20:03:46 EDT 2003


You could alias __getitem__ to "at" and word it as following, keeping
entirely in the spirit of this thread:

location = self stringCache at: string

"Paul D. Fernhout" <pdfernhout at kurtz-fernhout.com> wrote in message news:<3f457487_7 at corp.newsgroups.com>...
>
>       def addOrFindStringRecord: string readOnlyFlag: readOnlyFlag = 0
>          if not readOnlyFlag
>              self refreshLockFileIfNeeded
>          self checkOpen
>          if Options caching
>              try
>                   if self stringCache has_key: string
>                       location = self stringCache[string]
>                        return self readStringIndexRecord: location
>              except TypeError, e
>                   # may generate type error if object not hashable
> 		 pass
>           ...
> 
> (Not sure what to do about brackets, so I left them...)
>




More information about the Python-list mailing list