ALeX inSide alex.b.ins...@gmail.com 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
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
On Mon, Nov 26, 2012 at 9:56 AM, Nobody nob...@nowhere.com 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
On 11/26/2012 03:51 PM, Ian Kelly wrote:
On Mon, Nov 26, 2012 at 9:56 AM, Nobody nob...@nowhere.com 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
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 Mon, Nov 26, 2012 at 2:58 PM, Dave Angel d...@davea.name 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
On 27/11/12 00:07:10, Ian Kelly wrote:
On Mon, Nov 26, 2012 at 2:58 PM, Dave Angel d...@davea.name 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
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 is needed so
On 11/26/2012 06:07 PM, Ian Kelly wrote:
On Mon, Nov 26, 2012 at 2:58 PM, Dave Angel d...@davea.name 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
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 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 language,
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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
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 the function
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.
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 an
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
--
16 matches
Mail list logo