How can I explain in plain language what the Flask framework author wants to see in Python?

Source: Internet
Author: User
Original article: does PythonPython, the author of The Flask framework, really have this "biggest design error? Is it invisible to Python designers? Is the slots system really bad? Original article: Python to be viewed by the Flask framework author

Does Python really have this "biggest design error? Is it invisible to Python designers? Is the slots system really bad? Reply: The author threw out that the Python language is too tightly integrated with the CPython interpreter. Sometimes some implementations of the CPython interpreter become part of the language.
Although there are language specifications, in most cases, it only specifies what the interpreter is going to do, and even does not.

Python has a direct explanation in the "damn interpreter" section of the article:
The interpreter exposes these types of struct directly to Python code.

For example, you wrote a BigInteger class (just for example)

class BigInteger(object):    ...    def __add__(self, other):        return BigInteger(other.Value + self.Value)    ...
I think the author means that the current development mode of Python is to publicly collect the PEP and patch it based on the installed PEP, it almost never makes adjustments and improvements to the interpreter design left behind by the early history, and almost targets CPython. New features and languages become more and more complex, and old problems have not been improved. In addition, PSF is committed to interpreting some historical bad designs as the philosophy of Python ...... At the same time, the Python Documentation is actually a CPython document, so other implementations, such as Jython, PyPy, and IronPython, have to refer to these strange designs ......

His example shows that slots is designed to be fully compatible with some of the built-in methods of the early interpreter. from the current perspective, there is no need ......

In addition, GIL, if we follow the python philosophy, PSF says that this is easier to write C extensions or something, and that we only need an interpreter entity or something, we can clearly break away from GIL, this is also done by other companies, and the performance can indeed be greatly improved. besides, GIL brings obvious performance defects ...... There is no reason to put the single interpreter in the python philosophy ......

That's all ...... Therefore, Python and Ruby programming languages are basically implement-driven rather than specification-driven.

Ruby has been transformed from 1.8 to 1.9, which is still good.
Of course you will also see other people talking: Matz's Ruby Developers Don't Use RubySpec and It's Hurting Ruby The meaning of the entire article is:

Python clearly provides you with a set of standards, with your own backdoors working on your own;
It's tricky to write a lot of databases and so on. even new users, such as PyPy, cannot get through if they want to follow the standard, finally, they were forced to go through the backdoor;
What's more, his backdoor is not very advanced and has a bunch of defects. First of all, flask is doing a bad job, with chaotic test support. maybe the card is dead.

Then, many of the problems he mentioned are at the framework design level, such as slot, which is not commonly used by users and can be implemented even if similar functions are required.

There are indeed many problems at the Python C level. even I suspect that it is not a matter of accumulation, but a deliberate delay. Python3 decided to perform large-scale reconstruction a few years ago, but many core issues remained unchanged. For example, GIL is still process-level, not interpreter-level. According to the current status, if there is a Python4 day, it is definitely an incompatible upgrade.

Let's talk about it. for normal Python users, these discussions are useless. You can't use it anyway. Slot doesn't tell a big deal. cpython is opportunistic. it doesn't mean that other interpreters cannot be opportunistic. it's nothing more than a sloppy language, more slots than the dead.
I personally think that like flask, the author doesn't need to take it seriously. When will the bottle author start to talk about it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.