On 11/26/2012 11:10 PM, Steven D'Aprano wrote:
> On Mon, 26 Nov 2012 22:14:59 -0500, Dave Angel wrote:
>
>> On 11/26/2012 05:18 PM, Steven D'Aprano wrote:
>>> On Mon, 26 Nov 2012 16:58:47 -0500, Dave Angel wrote:
>>>
In a statically typed language, the valid types are directly implied
by
Steven D'Aprano wrote:
> Given the practical reality that documentation is often neglected, there
> is a school of thought that says that *code* is the One True source of
> information about what the code does, that documentation is at best a
> hint or at worst completely redundant.
Yes, there
On Mon, 26 Nov 2012 22:14:59 -0500, Dave Angel wrote:
> On 11/26/2012 05:18 PM, Steven D'Aprano wrote:
>> On Mon, 26 Nov 2012 16:58:47 -0500, Dave Angel wrote:
>>
>>> In a statically typed language, the valid types are directly implied
>>> by the function parameter declarations, while in a dynamic
On 11/26/2012 05:18 PM, Steven D'Aprano wrote:
> On Mon, 26 Nov 2012 16:58:47 -0500, Dave Angel wrote:
>
>> In a statically typed language, the valid types
>> are directly implied by the function parameter declarations, while in a
>> dynamic language, they're defined in the documentation, and only
On 11/26/2012 06:07 PM, Ian Kelly wrote:
> On Mon, Nov 26, 2012 at 2:58 PM, Dave Angel wrote:
>> Not how I would put it. In a statically typed language, the valid types
>> are directly implied by the function parameter declarations,
> As alluded to in my previous post, not all statically typed la
On Sunday, November 25, 2012 7:11:29 AM UTC-5, ALeX inSide wrote:
> How to "statically type" an instance of class that I pass to a method of
> other instance?
>
>
>
> I suppose there shall be some kind of method decorator to treat an argument
> as an instance of class?
>
>
>
> Generally it
On 27/11/12 00:07:10, Ian Kelly wrote:
> On Mon, Nov 26, 2012 at 2:58 PM, Dave Angel wrote:
>> Not how I would put it. In a statically typed language, the valid types
>> are directly implied by the function parameter declarations,
>
> As alluded to in my previous post, not all statically typed l
On Mon, Nov 26, 2012 at 2:58 PM, Dave Angel wrote:
> Not how I would put it. In a statically typed language, the valid types
> are directly implied by the function parameter declarations,
As alluded to in my previous post, not all statically typed languages
require parameter type declarations to
On Mon, 26 Nov 2012 16:58:47 -0500, Dave Angel wrote:
> In a statically typed language, the valid types
> are directly implied by the function parameter declarations, while in a
> dynamic language, they're defined in the documentation, and only
> enforced (if at all) by the body of the function.
On 11/26/2012 03:51 PM, Ian Kelly wrote:
> On Mon, Nov 26, 2012 at 9:56 AM, Nobody wrote:
>> In a dynamically-typed language such as Python, the set of acceptable
>> types for an argument is determined by the operations which the function
>> performs on it. This is in direct contrast to a statical
On Mon, Nov 26, 2012 at 9:56 AM, Nobody wrote:
> In a dynamically-typed language such as Python, the set of acceptable
> types for an argument is determined by the operations which the function
> performs on it. This is in direct contrast to a statically-typed language,
> where the set of acceptab
On Sun, 25 Nov 2012 04:11:29 -0800, ALeX inSide wrote:
> How to "statically type" an instance of class that I pass to a method of
> other instance?
Python isn't statically typed. You can explicitly check for a specific
type with e.g.:
if not isinstance(arg, SomeType):
raise T
ALeX inSide writes:
> How to "statically type" an instance of class that I pass to a method
> of other instance?
Python does not do static typing.
> I suppose there shall be some kind of method decorator to treat an
> argument as an instance of class?
Decorators are an option. Another is the u
ALeX inSide wrote:
I suppose there shall be some kind of method decorator to treat an argument as an
> instance of class?
You can do this:
xxx = MyClass.some_method
and then
i = MyClass()
xxx(i, foo, bar)
Does that help?
--
Greg
--
http://mail.python.org/mailman/listinfo/python-li
On Sun, 25 Nov 2012 04:11:29 -0800, ALeX inSide wrote:
> How to "statically type" an instance of class that I pass to a method of
> other instance?
Please explain what you mean by this.
What do you think "statically type" means?
> I suppose there shall be some kind of method decorator to treat
How to "statically type" an instance of class that I pass to a method of other
instance?
I suppose there shall be some kind of method decorator to treat an argument as
an instance of class?
Generally it is needed so IDE (PyCharm) can auto-complete instance's methods
and properties.
Pseudo-pyt
16 matches
Mail list logo