In article <4a0d2e07$0$9422$426a7...@news.free.fr>,
Bruno Desthuilliers wrote:
>Aahz a écrit :
>> In article <4a0c6e42$0$12031$426a7...@news.free.fr>,
>> Bruno Desthuilliers wrote:
>>> Marco Mariani a écrit :
Bruno Desthuilliers wrote:
> Oh, you meant the "return type" ? Nope, no way.
Aahz a écrit :
In article <4a0c6e42$0$12031$426a7...@news.free.fr>,
Bruno Desthuilliers wrote:
Marco Mariani a écrit :
Bruno Desthuilliers wrote:
Oh, you meant the "return type" ? Nope, no way. It just doesn't make
sense given Python's dynamic typing.
Unless he's really trying to write in N
On May 14, 3:55 pm, a...@pythoncraft.com (Aahz) wrote:
> In article <4a0c6e42$0$12031$426a7...@news.free.fr>,
> Bruno Desthuilliers wrote:
>
> >Marco Mariani a écrit :
> >> Bruno Desthuilliers wrote:
>
> >>> Oh, you meant the "return type" ? Nope, no way. It just doesn't make
> >>> sense given Py
Aahz wrote:
In article <4a0c6e42$0$12031$426a7...@news.free.fr>,
Bruno Desthuilliers wrote:
Marco Mariani a �crit :
Bruno Desthuilliers wrote:
Oh, you meant the "return type" ? Nope, no way. It just doesn't make
sense given Python's dynamic typing.
Unless he's really trying to write in Noht
In article <4a0c6e42$0$12031$426a7...@news.free.fr>,
Bruno Desthuilliers wrote:
>Marco Mariani a écrit :
>> Bruno Desthuilliers wrote:
>>>
>>> Oh, you meant the "return type" ? Nope, no way. It just doesn't make
>>> sense given Python's dynamic typing.
>>
>> Unless he's really trying to write i
Marco Mariani a écrit :
Bruno Desthuilliers wrote:
Oh, you meant the "return type" ? Nope, no way. It just doesn't make
sense given Python's dynamic typing.
I thought that the OP was writing a tool to document not-very-dynamic code.
Unless he's really trying to write in Nohtyp,
You mean
Bruno Desthuilliers wrote:
Oh, you meant the "return type" ? Nope, no way. It just doesn't make
sense given Python's dynamic typing.
I thought that the OP was writing a tool to document not-very-dynamic code.
Unless he's really trying to write in Nohtyp, the language where value
types are mo
On the other hand, generally good programming practice suggests you to
write functions that have a constant return type. And in most programs
most functions are like this. This is why ShedSkin can indeed infer
the return type of functions in "good behaved" programs. To do this
ShedSkin uses a quite
flam...@gmail.com a écrit :
Hello,
I am wondering if it's possible to get the return value of a method
*without* calling it
Getting the return *value* without calling the function ? heck, that
would be really helpful - we'd save quiet a lot on function call
overhead and function execution tim
Diez B. Roggisch wrote:
> flam...@gmail.com wrote:
>
>> Hello,
>> I am wondering if it's possible to get the return value of a method
>> *without* calling it using introspection?
>
> Nope. All that's possible to see if there is a implicit or explicit return
> through dis.disassemble - if you fin
flam...@gmail.com:
> I am wondering if it's possible to get the return value of a method
> *without* calling it using introspection?
Python is dynamically typed, so you can create a function like this:
>>> foo = lambda x: "x" if x else 1
>>> foo(1)
'x'
>>> foo(0)
1
The return type of foo() chang
flam...@gmail.com wrote:
> Hello,
> I am wondering if it's possible to get the return value of a method
> *without* calling it using introspection?
Nope. All that's possible to see if there is a implicit or explicit return
through dis.disassemble - if you find "LOAD_CONST None" before any
return-
Hello,
I am wondering if it's possible to get the return value of a method
*without* calling it using introspection?
something like this, suppose I want to know the type of the return
value for the method "getsomething". Is it possible to get it without
actually calling 'getsomething'?
ex:
import
Alex K wrote:
Please don't top-post.
> On 07/01/2008, Peter Otten <[EMAIL PROTECTED]> wrote:
>> Alex K wrote:
>>
>> > What would be the simplest way of enumerating all methods and members
>> > (including inherited) of a given object? Thank you.
>>
>> inspect.getmembers()
> Nice thank you. But an
2008/1/7, Alex K <[EMAIL PROTECTED]>:
> Nice thank you. But anyway to make it look pretty?
>
pprint.pprint(inspect.getmembers(someobject))
> On 07/01/2008, Peter Otten <[EMAIL PROTECTED]> wrote:
> > Alex K wrote:
> >
> > > What would be the simplest way of enumerating all methods and members
> >
Nice thank you. But anyway to make it look pretty?
On 07/01/2008, Peter Otten <[EMAIL PROTECTED]> wrote:
> Alex K wrote:
>
> > What would be the simplest way of enumerating all methods and members
> > (including inherited) of a given object? Thank you.
>
> inspect.getmembers()
>
> Peter
> --
> htt
Alex K wrote:
> What would be the simplest way of enumerating all methods and members
> (including inherited) of a given object? Thank you.
inspect.getmembers()
Peter
--
http://mail.python.org/mailman/listinfo/python-list
2008/1/7, Alex K <[EMAIL PROTECTED]>:
> Hi Guys,
>
> What would be the simplest way of enumerating all methods and members
> (including inherited) of a given object? Thank you.
>
> Alex
> --
> http://mail.python.org/mailman/listinfo/python-list
>
import inspect
inspect.getmembers(yourobject)
--
Hi Guys,
What would be the simplest way of enumerating all methods and members
(including inherited) of a given object? Thank you.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
19 matches
Mail list logo