Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Class confusion

Reply
Thread Tools

Re: Class confusion

 
 
MRAB
Guest
Posts: n/a
 
      01-09-2013
On 2013-01-09 20:13, Rodrick Brown wrote:
> How can I make a class that has methods with attributes and other
> functions?
> I see a lot of code
>
>
> I'm reading the documentation to Redhat's Satellite software which has a
> XMLRPC interface and wrote the following code to test the api.
>
> I would like to extend this code to support methods with methods? I see
> this done a lot in python code but I'm not sure how to accomplish
> something like this?
>
> i.e.
>
> sc = SatelliteConnect()
> sc.get_systemlist().get_systemid() ?
> or
> sc.get_systemlist().get_running_kernel()
>
> How does one chain methods and attributes like this with classes?
>

[snip]
This:

sc.get_systemlist().get_systemid()

simply means that the method "get_systemlist" returns an instance of
some class (let's call it "SystemList") which has a method
"get_systemid".

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Class A contains class B, class B points to class A Joseph Turian C++ 5 12-30-2005 03:24 PM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
A parameterized class (i.e. template class / class template) is not a class? christopher diggins C++ 16 05-04-2005 12:26 AM
Class Confusion Fao, Sean C++ 4 09-01-2004 11:26 PM
help needed with class and method confusion Cndistin Python 3 01-06-2004 09:56 PM



Advertisments