Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Blog -  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Preferences
Contribute
Link to Us
Search
Linux Jobs

Linux Today
Enterprise Linux Today
Apache Today
JustLinux.com
Linux Planet
PHPBuilder
All Linux Devices
Technology Jobs

JustTechJobs.com

LinuxToday Newsletters
Server Daily
IT Management Daily
Subscribe News
Subscribe PR
Subscribe Security

internet.com
Internet News
Small Business

Advertise
Newsletters
Tech Jobs
E-mail Offers

 






Current Newswire:

Linux Top 5: Linux's New Fellow

RebeccaBlackOS - First Live CD Running Wayland Display Server

The Linux powered LAN Gaming House

5 Best Android Apps For Reddit Lovers

SECURITY: Flash Player Sandbox Comes to Firefox

The Future of Kubuntu

SECURITY: Symantec should not be afraid of 'open' source code

Linux 3.3 rc3

60 Fantastic Free Android Apps

Ready for Another Linux Tablet? Meet the Rugged Trimble Yuma



Applications Management Engineer Sr (NYC)
Next Step Systems
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
:Intro to Python Introspection and Dynamic Programming
Intro to Python Introspection and Dynamic Programming
Jul 1, 2009, 03 :02 UTC (0 Talkback[s]) (5390 reads)

(Other stories by Phillip Watts)

"In this example we have defined a parent class, Device, which has attributes, and some child classes which contain their particular attributes. We have created a list of instances of the devices. In the "for loop" we do something only if the device has the attribute getEths. Therefore we are using internal information about the program, i.e. its classes, to control the program's behaviour.

"By the way, this is sometimes referred to as "duck typing". If it looks like a duck it must be a duck, therefore you can treat it as a duck.

"Before proceeding, we should note that the Python language has much similarity to a Python program, in that, everything in the language is an object. For now we will limit the discussion to classes and instances of classes. Just remember that Python has many built in classes, there are hundreds in the "standard" libraries,and many thousands which can be downloaded and all of the classes themselves share some common properties."

Complete Story

Related Stories:
A Beginner's Guide to Free Software Programming Languages(Jun 27, 2009)
Leveraging Industrial-strength Python Testing(Jun 26, 2009)
A Python Client/Server Tutorial(Jun 20, 2009)
PythonGTK Programming part 3: Screensaver, Objects, and User Input(Jun 11, 2009)
Python testing frameworks: Finding modules to test(Jun 05, 2009)
Traffic accounting with SNMP and Python on Windows(Jun 01, 2009)
Graphical Python Programming part 2: Write Your Own Screensaver(May 28, 2009)
Graphical Python Programming With PyGTK(May 14, 2009)
Python's optparse for human beings(Apr 30, 2009)



No talkbacks posted.
  Home | Search Talkbacks | Customize View    Top of Page  



Enter your comments below:

* Your Name:

* Your Email Address:

* Subject:

CC: [will also send this talkback to an E-Mail address]

* Comments:

Tags allowed:<I>,<B> and <U>. See our talkback-policy for more about talkback content.

Fields marked with * are required!

..............................




All times are recorded in UTC.
Linux is a trademark of Linus Torvalds.
Powered by Linux, Apache and PHP