On Apr 1, 2016 17:07, "Volker Braun" wrote:
>
> On Friday, April 1, 2016 at 4:19:08 PM UTC+2, Erik Bray wrote:
>>
>> One of my top wishlist items for Python 4 is some kind of __hasattr__
>> special method for classes and/or an equivalent for descriptors that
>> merely guarantees* that accessing th
On Friday, April 1, 2016 at 4:19:08 PM UTC+2, Erik Bray wrote:
>
> One of my top wishlist items for Python 4 is some kind of __hasattr__
> special method for classes and/or an equivalent for descriptors that
> merely guarantees* that accessing the attribute of that name will not
> result in an A
On Thu, Mar 31, 2016 at 11:08 PM, Justin C. Walker wrote:
> Hi, all,
>
> I have couple of questions regarding "attributes" in Python/Sage:
>
> 1. If hasattr(X, "foo") returns True, does that mean that "X.foo" should not
> blow up?
Yes, this does, because unfortunately hasattr(X, 'foo') actually
On Friday, April 1, 2016 at 1:24:30 AM UTC+2, Justin C. Walker wrote:
>
> > Just because a method is callable doesn't mean that it can't raise
> > exceptions, including NotImplementedErrors. There's no reasonable way
> to
> > tell if a method will raise an exception or not without calling it.
On Mar 31, 2016, at 16:15 , David Roe wrote:
> On Thu, Mar 31, 2016 at 7:11 PM, Justin C. Walker wrote:
>
>>
>> On Mar 31, 2016, at 15:37 , Vincent Delecroix wrote:
>>
>>> On 31/03/16 18:22, Johannes wrote:
On 31.03.2016 23:08, Justin C. Walker wrote:
> 2. Is there a way to tell, whe
On Thu, Mar 31, 2016 at 7:11 PM, Justin C. Walker wrote:
>
> On Mar 31, 2016, at 15:37 , Vincent Delecroix wrote:
>
> > On 31/03/16 18:22, Johannes wrote:
> >> On 31.03.2016 23:08, Justin C. Walker wrote:
> >>> 2. Is there a way to tell, when hasattr(X, "foo") returns True,
> >>> whether "X.foo"
On Mar 31, 2016, at 15:37 , Vincent Delecroix wrote:
> On 31/03/16 18:22, Johannes wrote:
>> On 31.03.2016 23:08, Justin C. Walker wrote:
>>> 2. Is there a way to tell, when hasattr(X, "foo") returns True,
>>> whether "X.foo" can be called?
>>
>> X.foo and x.foo.__call__ is None
>
> !?
>
> The
On Mar 31, 2016, at 14:17 , William Stein wrote:
> On Thu, Mar 31, 2016 at 2:08 PM, Justin C. Walker wrote:
>> Hi, all,
>>
>> I have couple of questions regarding "attributes" in Python/Sage:
>>
>> 1. If hasattr(X, "foo") returns True, does that mean that "X.foo" should not
>> blow up?
>
> W
On 31/03/16 18:22, Johannes wrote:
On 31.03.2016 23:08, Justin C. Walker wrote:
2. Is there a way to tell, when hasattr(X, "foo") returns True,
whether "X.foo" can be called?
X.foo and x.foo.__call__ is None
!?
The only way to go here is
if callable(X.foo):
print "X.foo is callable"
V
On 31.03.2016 23:08, Justin C. Walker wrote:
Hi, all,
I have couple of questions regarding "attributes" in Python/Sage:
1. If hasattr(X, "foo") returns True, does that mean that "X.foo" should not
blow up?
this means X.foo is defined.
2. Is there a way to tell, when hasattr(X, "foo") return
On Thu, Mar 31, 2016 at 2:08 PM, Justin C. Walker wrote:
> Hi, all,
>
> I have couple of questions regarding "attributes" in Python/Sage:
>
> 1. If hasattr(X, "foo") returns True, does that mean that "X.foo" should not
> blow up?
What's the definition of "blow up"? I think X.foo could -- due t
Hi, all,
I have couple of questions regarding "attributes" in Python/Sage:
1. If hasattr(X, "foo") returns True, does that mean that "X.foo" should not
blow up?
2. Is there a way to tell, when hasattr(X, "foo") returns True, whether "X.foo"
can be called?
3. If "X.foo" is callable, is it expe
12 matches
Mail list logo