| def lookup( query ) | regex=$"${person.lastname},${person.firstname}: .*${query}=(\w+)" | .... So let me try to guess what you mean here. I really have no idea if I'm right. $"..." is some new type of syntax that says to do magic name lookup and interpolation when creating the string. person.lastname must be an attribute on some object bound to the variable `person'. Where does `person' come from? I guess you'd use the normal namespace rules, so if I saw this function in your code I'd have to assume that person appears in the globals (because putting it in builtins is bad form and I don't see it in the function's locals). But you really don't need any of that new magic stuff or new syntax (or is it a new string type?). The nugget of interesting new functionality here is that your doing attribute lookup inside a string interpolation, and /that/ might be a cool thing to have. E.g. def lookup(query): regex = '%(person.lastname)s,%(person.firstname)s: .*%(query)s=(\w+)' \ % vars() seems reasonable to me, and doesn't add nearly as much new or magical stuff as your example above. -Barry
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4