【发布时间】:2010-11-30 04:55:25
【问题描述】:
http://www.ironpython.info/index.php/Using_Python_Classes_from_.NET/CSharp_IP_2.6
string code = @"
print 'test = ' + test
class MyClass:
def __init__(self):
pass
def somemethod(self):
print 'in some method'
def isodd(self, n):
return 1 == n % 2
";
“@”是 C# 的一部分还是 IronPython 添加的东西?如果是后者,你如何在 C# 中做到这一点,某种运算符重载(基本上我可以让'@'做任何我想做的事情,等等)?示例实现会很棒。不然怎么回事?
【问题讨论】:
标签: c# ironpython