【发布时间】:2015-08-08 03:19:37
【问题描述】:
我有这样的命名空间有错误
errorMessages=
error404Find: "Hosts not found"
error404FindByHost: "Host - #{hostName} - not found"
error400: "No host"
hostName 应分配给 null 并在如下函数中覆盖:
this.hostName = 'smth'
或者我可以在 python 中使用类似的东西:
errorMessages=
{'error404Find': "Hosts not found"
'error404FindByHost': "Host - {hostName} - not found"
'error400': "No host"}
errorMessages['error404FindByHost'].format(hostName='smth')
【问题讨论】:
标签: python string coffeescript string-interpolation language-comparisons