snippets/test/Python @Decorador

13 lines
251 B
Plaintext
Raw Permalink Normal View History

2024-10-02 23:47:38 +00:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class decorador(object):
def __init__(self, func):
print "Welcome to"
func()
def __call__(self):
print "python :)"
@decorador
def luser():
print "World of"
print "decorators at"
luser()