views:

74

answers:

1

In SharpDevelop, I want to create a dll which contains a static methon, void Main(string[] args).

Some one said I should use decorator to restrict the function in IronPython.

I found "@staticmethod", but others, "void", "string[] args", how to restrict them?

class MyClass:
    def __init__(self):
        pass
    @staticmethod   
    def Main(args):
        pass    
A: 

Python doesn't have return types. Just don't return anything. You can do this either by using an empty return statement or by not using a return statement at all

aaronasterling
You can actually define return types in IronPython using clrtype.returns() decorator, to make it a clr method, which has return types.
jcao219
@ jcao219 :But, What about arguments?
Begtostudy
use @clrtype.accepts()
aaronasterling
@ jcao219:Thanks.
Begtostudy
不客气 (I believe you are Chinese)
jcao219
@ jcao219:Yes. But my english is poor so that administrators always edit my questions for grammar like "be loaded" to "be loaden",^_^.
Begtostudy