473,388 Members | 1,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Re: Hi, Pythoners.



AON LAZIO wrote:
I have come across this code and I tried to figure out what does it do
First, I do not understand the sign @... above the class method, what
does it do?
Second, about the object in AnyWrapper(object), why do they declare
"object" as the superclass?
sometimes I saw (type) what the differences between "object" and "type"?
Object is the base class. Type is the base metaclass. Reread the class
statement doc. @statements are decorators. I believe they are
documented along with function statements, though in 3.0 they apply to
classes also.
>

from ib.lib.overloading import overloaded

class AnyWrapper(object):
@overloaded
def error(self, e):
raise NotImplementedError()
@error.register(object, str)
def error_0(self, strval):
raise NotImplementedError()

Thanks in advance

Aonlazio
------------------------------------------------------------------------

--
http://mail.python.org/mailman/listinfo/python-list
Aug 13 '08 #1
0 703

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: J.R. | last post by:
Hi folks, The python can only support passing value in function call (right?), I'm wondering how to effectively pass a large parameter, such as a large list or dictionary? It could achieved...
1
by: sarmin kho | last post by:
Hi Pythoners... I am building a python GUI with wxpython... the python GUI will periodically call a python module written on python 2.2... wxtimer is used to enable the periodic call... it works...
3
by: sarmin | last post by:
Hi Pythoners... It seems to me the Asterisk (*) sign in python means many things... if a python code line looks like this: def__init__(self, func, *param): bla bla bla... and then u have...
1
by: sarmin kho | last post by:
Hi Pythoners... I am definitely confused with the use of asterisk (*) sign in python... I quoted the following code from 'python cookbook' text book page 223 about 'running functions in the...
6
by: ..:: sjf ::.. | last post by:
Hello Pythoners! There are a lot of files containing data such as: file1: 0950 1550 file22: 0952 1552
1
by: sarmin kho | last post by:
Hi Pythoners, i remember that i saw posting about changing the icon of a python executable but i kind of lost where to find the posting... basically, this is my first time using the py2exe to...
105
by: Peter Hickman | last post by:
Well after all this discussion it would appear that a 'Python like' language has appeared => Prothon. http://www.prothon.org/index.html Very alpha, sort of like Python (if you consider the...
385
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons. The less educated they are, the more they like...
37
by: Xah Lee | last post by:
A Moronicity of Guido van Rossum Xah Lee, 200509 On Guido van Rossum's website: http://www.artima.com/weblogs/viewpost.jsp?thread=98196 dated 20050826, he muses with the idea that he would...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.