String changing on the fly
Paul McGuire
ptmcg at austin.rr._bogus_.com
Wed Oct 20 14:41:45 EDT 2004
More information about the Python-list mailing list
Wed Oct 20 14:41:45 EDT 2004
- Previous message (by thread): String changing on the fly
- Next message (by thread): String changing on the fly
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"John Hunter" <jdhunter at ace.bsd.uchicago.edu> wrote in message news:mailman.5235.1098294536.5135.python-list at python.org... > >>>>> "John" == John Hunter <jdhunter at nitace.bsd.uchicago.edu> writes: > > > Continuing the fun, you can define a new python class that inherits > from string, but overrides the "convert me to a string representation" > method __str__ to evaluate itself in the context of the global > variables > > import re > > > class PerlString(str): <snip> How do you know the language was Perl? Could be Tcl, which also uses the '$' substitution form. (Although "T=100" would be written "set T 100" in that case.) -- Paul
- Previous message (by thread): String changing on the fly
- Next message (by thread): String changing on the fly
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list