Re: Hi, Pythoners.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Reedy

    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(obje ct), 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.overload ing import overloaded
    >
    class AnyWrapper(obje ct):
    @overloaded
    def error(self, e):
    raise NotImplementedE rror()
    @error.register (object, str)
    def error_0(self, strval):
    raise NotImplementedE rror()
    >
    Thanks in advance
    >
    Aonlazio
    >
    >
    ------------------------------------------------------------------------
    >
    --
    http://mail.python.org/mailman/listinfo/python-list
Working...