When to Use Object-oriented Programming(Chapter 5 of Python 3 Object Oriented Programming)
2010-09-02 20:52
856 查看
code 1 class Silly:
2
3 @property
4 def silly(self):
5 "This is a silly property"
6 print("You are getting silly")
7 return self._silly
8
9 @silly.setter
def silly(self, value):
print("You are making silly {}".format(value))
self._silly = value
@silly.deleter
def silly(self):
print("Whoah, you killed silly!")
del self._silly
2
3 @property
4 def silly(self):
5 "This is a silly property"
6 print("You are getting silly")
7 return self._silly
8
9 @silly.setter
def silly(self, value):
print("You are making silly {}".format(value))
self._silly = value
@silly.deleter
def silly(self):
print("Whoah, you killed silly!")
del self._silly
相关文章推荐
- When Objects are Alike(Chapter 3 of Python 3 Object Oriented Programming)
- Common Python 3 Libraries(Chapter 12 of Python 3 Object Oriented Programming)
- Objects in Python(Chapter 2 of Python 3 Object Oriented Programming)
- Python Design Patterns I(Chapter 8 of Python 3 Object Oriented Programming)
- Python Design Patterns II(Chapter 9 of Python 3 Object Oriented Programming)
- Python Object-oriented Shortcuts(Chapter 7 of Python 3 Object Oriented Programming)
- Files and Strings(Chapter 10 of Python 3 Object Oriented Programming)
- Testing Object-oriented Programs(Chapter 11 of Python 3 Object Oriented Programming)
- When to Use Delegates Instead of Interfaces (C# Programming Guide)
- Know When to Use an Active Object Instead of a Mutex
- 干活来袭:Effective Concurrency: Know When to Use an Active Object Instead of a Mutex
- Beginning C# 3.0: An Introduction to Object Oriented Programming
- Describe 3 kernel functions and when to use which of them
- Question 33: How can a C++ developer use the placement new syntax to make new allocate an object of class SomeClass at a particu
- <<DEITEL - Python How to Program 2002>>Special attributes of an object of a class.0.0.0.3
- When to Use Bar Charts Instead of Pie Charts
- Introduction to F#(Chapter 1 of Programming F#)
- When to Use Delegates Instead of Interfaces
- how to use Decimal by default instead of float in python
- Python multiprocessing.Pool: when to use apply, apply_async or map?