[EMAIL PROTECTED] schrieb:
> Hi,
> Is there a python command that allows me to extract the names (not
> values) of the attributes of a class.
>
> example
>
> Class Sample:
> fullname = 'Something'
>
> How can I know that this class has an attribute called 'fullname'?
>
> I hope my question
On Mar 7, 12:30 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
> | Hi,
> | Is there a python command that allows me to extract the names (not
> | values) of the attributes of a class.
> |
> | example
> |
> | Class Sample:
> |fullna
On Mar 6, 1:14 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi,
> Is there a python command that allows me to extract the names (not
> values) of the attributes of a class.
>
> example
>
> Class Sample:
> fullname = 'Something'
>
> How can I know that this class has an attribute called
> Class Sample:
> fullname = 'Something'
>
> How can I know that this class has an attribute called 'fullname'?
with the builtin hasattr() function :)
>>> class Sample: fullname='Something'
...
>>> hasattr(Sample, 'fullname')
True
-tkc
--
http://mail.python.org/mailman/listinfo/python-
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Hi,
| Is there a python command that allows me to extract the names (not
| values) of the attributes of a class.
|
| example
|
| Class Sample:
|fullname = 'Something'
|
| How can I know that this class has an attribute called 'full
Hi,
Is there a python command that allows me to extract the names (not
values) of the attributes of a class.
example
Class Sample:
fullname = 'Something'
How can I know that this class has an attribute called 'fullname'?
I hope my question is clear.
Thanks
--
http://mail.python.org/mail