Linux Today: Linux News On Internet Time.
Search Linux Today
search.internet.com
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

Become a Marketplace Partner

internet.commerce
Be a Commerce Partner














The Linux Channel at internet.com
Linux Today
Enterprise Linux Today
Apache Today
JustLinux.com
Linux Planet
PHPBuilder
All Linux Devices
Technology Jobs

JustTechJobs.com

LinuxToday Newsletters
Subscribe News
Subscribe PR
Subscribe Security

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

 






Current Newswire:

Saving the "Best" for Last - Fedora 12 (Constantine)

LinuxCertified Announces its next Linux System and Network Administration BootCamp

The Problem With The Linux Community

Vim 101: A Beginner's Guide to Vim

Open Source Science: A Revolution From Within

openSUSE 11.2-- Incremental Updates, Plenty of Polish

Microsoft, other rivals slam Google Chrome OS

Intel Linux Graphics Shine With Fedora 12

Editor's Note: Do It Yourself "Cloud"

Google Chrome OS: First looks, first impressions




Arcsight Engineer
The Computer Merchant, Ltd
US-DC-Washington

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]) (2972 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

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs