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:

Top 10 areas where open source leads the way

Best Linux Distributions of the Decade (2000-2009)

The iPad questions Apple won't answer

HP Launches First Quad-Core Itanium Systems

Dell Ubuntu Order Experience

Power Up Linux GUI Apps

Ksplice debuts zero downtime service for Linux

BM Ups Its Processor Power to 7

KDE.org Relaunched for Software Compilation 4.4

The application is the new the operating system




Systems Engineer Sr – Automation – Opsware SAS / HP SA
Next Step Systems
US-TX-Houston

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


The Network for Technology Professionals

Search:

About Internet.com

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