Message140010
| Author |
py.user |
| Recipients |
py.user |
| Date |
2011年07月08日.00:36:48 |
| SpamBayes Score |
0.00048329867 |
| Marked as misclassified |
No |
| Message-id |
<1310085409.68.0.478281072881.issue12518@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
>>> import string
>>> class MyTemplate(string.Template):
... delimiter = '.'
...
>>> MyTemplate.delimiter = 'x'
>>> mt = MyTemplate('.field xfield')
>>> mt.substitute(field=None)
'None xfield'
>>> mt.delimiter
'x'
>>>
If I want to change the pattern string by any delimiter, I should create a new class for every delimiter
I would change the delimiter either in the object or in the class at any time |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年07月08日 00:36:49 | py.user | set | recipients:
+ py.user |
| 2011年07月08日 00:36:49 | py.user | set | messageid: <1310085409.68.0.478281072881.issue12518@psf.upfronthosting.co.za> |
| 2011年07月08日 00:36:49 | py.user | link | issue12518 messages |
| 2011年07月08日 00:36:48 | py.user | create |
|