今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Advanced classes overview
- [Instructor] You've probably created your own Python classes in programs you've written before. And in this chapter, we're going to learn about some of the more advanced features of Python classes and how to customize the behavior of classes. Python itself is a very customizable language and it provides a variety of ways to control how objects are created, converted to strings, compared to each other and much more. This customize ability is achieved by using special functions and features that are part of every object defined in Python. You can use Python classes to create enumerations which you may be familiar with from other languages like Java or C++. You could also customize how your objects are converted to string values when they are passed to Python functions such as str or repr, classes can also have computed and default attributes, and you can define functions that let classes be compared to each other. Using logical operations like greater than, less than and so on. You…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。