You can subscribe to this list here.
2009 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Paul H. <Pau...@di...> - 2009-05-02 15:49:48
|
Michal and I were chatting back and forth in a Pythoscope code review about documenting function parameters. He also bought up using typecheck (http://oakwinter.com/code/typecheck/) for the times when he really wants to check parameter type. That led to a stream of though about possibly having something like typecheck work with typing information in the doc string. I know that both Doxygen and Epydoc support a @param tag for the doc string. Epydoc also supports @type for specifying the parameters type. I am not sure how it would work but it would be cool if when we wanted type checking we could specify it in the doc string and it would just magically work. Maybe what we would have to do is put type checking in the code that the documentation engine would recognize. That seems a little more doable. Anyway I am just sharing an idea, maybe a crazy one, in hopes of feedback. Thoughts? Paul |
From: shi d. <shi...@gm...> - 2009-01-14 13:48:05
|
Sorry, I wrote my last e-mail too fast (my example is totally wrong). My objective is to define a class where some attributes can be optionnal. If an optionnal attribute is defined then it should be a String for example. I would like to have something like : String = IsOneOf(str, unicode, NoneType) class MyClass(object): @accept(String, String) def __init__(a, b=None): blabla ... but None cannot be used with the operator IsOneOf, etc. Does it mean that with typecheck, a method or function looses its ability to have optionnal argument ? Thx, Marc. 2009/1/11 shi dingan <shi...@gm...> > Hi, > > I would like to define a class where an > attribute can be None. > For instance : > @accept(String, String) > class MyClass(a, b=None): > if b: > return b > else: > return a > I didn't find a way to use typecheck on this kind > of class. I tried to define String with > String = IsOneOf(str, unicode, NoneType) but it does > not work. It seems that 'None' can not > be checked. Have you any idea ? > > Regards, > Marc. > > |
From: shi d. <shi...@gm...> - 2009-01-11 10:55:42
|
Hi, I would like to define a class where an attribute can be None. For instance : @accept(String, String) class MyClass(a, b=None): if b: return b else: return a I didn't find a way to use typecheck on this kind of class. I tried to define String with String = IsOneOf(str, unicode, NoneType) but it does not work. It seems that 'None' can not be checked. Have you any idea ? Regards, Marc. |