Interpreting Hong Kong’s top 10 hit comedies: Why they can defeat Stephen Chow


1905 movie network feature In the second half of 2022, the Hong Kong film market in China will be very lively.After six years, surpassing the results of 66.82 million Hong Kong dollars, it jumped to the box office champion of Hong Kong film history Chinese film, and then surpassed to win the highest box office Asian film in Hong Kong film history. Up to now, the cumulative box office of the film has exceeded 76 million and continues to set new records.



Not only in the mainland box office breakthrough 100 million RMB, since the September 7 release in Hong Kong, 6 consecutive weeks to top the weekly box office champion, while surpassing the "Mermaid" "Shaolin Football" and other comedies, won the first box office of Hong Kong-made comedy films, but also became the second runner-up of Hong Kong film history Chinese film box office.



Together, they have reshaped the box office rankings of Hong Kong film history. This year, the number of viewers of Hong Kong films is also the largest in the past three years. Has Hong Kong film ushered in an explosive recovery?


Four box office hits, Hong Kong films come back? 


"Tomorrow’s War" and "I Still Think You’re the Best" have not only surpassed "Cold War 2" at the box office, but also exceeded one million viewers.


In addition to these two hits, in the summer from July to August, the box office of "Family Spicy" starring Jiang Tao exceeded 30 million Hong Kong dollars. "Superstar" starring Jiang Tao (Hong Kong title "Grandma has a second") is also approaching the 40 million box office.



According to the statistics of 1905 film network, from 1987 to 1995, at least three Hong Kong-made films exceeded the box office 30 million in Hong Kong every year, and the number exceeded ten in 1992. The last time there were four Hong Kong-made films at the box office exceeded 30 million Hong Kong dollars, or frame freeze in 95, respectively: 56.91 million, 45.67 million, 35.23 million, 33.77 million.


Although ticket prices in Hong Kong cinemas are now more than double what they were in the 1990s, and there is inflation compared with the past, these four films still have very important indicative significance when they reappear after 27 years.



At the beginning of the year, Hong Kong cinemas were completely closed for more than three months due to the impact of the pandemic. After resuming business on April 21, the market gradually picked up in May and June, and the attendance rate increased to normal levels. The release of "Family Spicy" on July 14 set off the first wave of "return" movie viewing craze for Hong Kong audiences.


"Tomorrow’s War", "I Still Think You’re the Best" and "Superstar" have all received praise from Hong Kong audiences. All three films have a score of 7 on WMOOV, a well-known online movie platform in Hong Kong. "Superstar" topped the list with 7.9, the best reputation among audiences.



At present, "Tomorrow’s War" has landed in Hong Kong theaters for two months, and "I Still Think You’re the Best" has also lasted for more than a month and a half. The two films continue to make moves to maintain their endurance and boost the box office.


"Tomorrow’s War" adds an animated prequel 30-second prequel trailer at the end of the original film to attract more audiences to watch in theaters. The filmmakers recently announced that from October 20, anyone who buys two tickets to "Tomorrow’s War" in theaters will receive a "prequel Symphony Commemorative Ticket".



"Still Think You’re the Best" took advantage of the victory to launch an extended version on October 15, adding 6 minutes of new clips to the original, including four never-before-seen scenes. At the same time, the film company launched a board game of the same name, a full record book of film creation and screenplay, and held a wide-ranging meeting to help maintain the popularity of the market.



However, the film market cannot just watch a few movies that have achieved good results in the popular schedule, such as "Beauty in the Heart", (Hong Kong title "All the way to the pupil"), etc. The box office is not as expected, and the reputation is also average.


It can be seen that the current Hong Kong film has a rare state of "two superpowers and two strong", but there is still a long way to go before a full-scale revival.


To defeat Stephen Chow and surpass "Chills 2", why? 


As the largest sci-fi blockbuster in Hong Kong’s history, "Tomorrow’s War" created the best opening result of a non-holiday Hong Kong film in the past five years on its first day of release, and also broke the best opening result of a starring film in the past year. The film quickly broke through 20 million Hong Kong dollars in 4 days of release, and broke through 30 million Hong Kong dollars in the first week, galloping all the way to the cinema.


The reason why this film was able to win the box office championship of Hong Kong film history Chinese film from "Cold War 2" is its integration of Hong Kong-style police and gangster films and mecha sci-fi films, the breakthrough of Hong Kong sci-fi film production technology, the observation of Hong Kong’s local stories, and the hard publicity of the producer and star Gu Tianle.



The low-budget production of "Still Think You’re the Best" has succeeded in a small and broad scale. Who would have expected it to overtake Chow’s many comedies all the way, and it is expected to become the first comedy in Hong Kong’s film history to break the 70 million box office.


Why is "I Still Think You’re the Best" the biggest dark horse of the year?As a well-known local comedian in Hong Kong, he has always had a box office appeal that cannot be underestimated. In recent years, he starred in the tenth box office of Hong Kong film history comedies, and "What Generation Grandmaster" also won about 30 million box office. It is the hottest movie in Hong Kong during the Spring Festival in 2020.



The film has a strong "happy event" series of comedy spirit, which has revived the vitality of Hong Kong’s classic star-celebrating comedy, which is also a big factor in its box office surge.


In 1988, the leading 37.09 million broke the box office record of 34.65 million, and then he used this as a model to create "auspicious star" and "97 happy events" in the 1990s to enter the top of the Hong Kong box office, the reputation is good., Zhou Xingchi, starring in the 92 version of "Happy Events at Home" is still one of the top ten hit comedies in Hong Kong.


Since 2010, Huang Baiming has once again reinvented the "Happy Event" sign, launching "The Strongest Happy Event" and "Happy Event at Home 2020" in succession, winning the box office and losing word of mouth. The quality of the film and the cast are not as good as before.



"Still Think You’re the Best" can be described as "full of color and fragrance". It not only brings the old taste of Hong Kong-made New Year’s comedy, but also deeply depicts family conflicts and love relationships between men and women. It also hits the majority of Hong Kong audiences, which is also the key reason why it can break the billion box office in the mainland.


According to data from Lighthouse Professional Edition, in the mainland market, 48.8% of the number of people who wanted to see the film came from Guangdong Province, which also ranked first in the box office contribution. "Still Think You’re the Best" firmly grasps the core tastes of audiences in the Greater Bay Area.



The comedy "Family Spicy", which is close to the family story of local Hong Kong people, also won the resonance of Hong Kong audiences. The film tells the story of a family who started a new business by making and selling chili sauce under the epidemic, and is full of warmth and hope in laughter.


Based on this wave of enthusiasm, the director of "Still Think You’re the Best" has expressed the hope that the original crew can reunite for a new play. It can be seen that in the future, this kind of Hong Kong-style family comedy sketch will continue to be rejuvenated and is an indispensable force in the Hong Kong film market.



The two big winners in Hong Kong this year are Koo Tian-le and Koo Tian-le: In addition to "Tomorrow’s War", Koo Tian-le’s Tiantian One Film Company also participated in "Still Think You’re the Best" and "Family Hot". In addition to "Still Think You’re the Best" and "Cold War 2", Jiang Zhiqiang’s Anle Film Company occupies three of the top four seats in Hong Kong’s film history box office.


"Fight side by side, go down together", they support local stories and support new directors. Just as "Tomorrow’s War" and "Family Hot" jointly thanked the votes, "Still Think You’re the Best" and "Late Night Dodgeball" also did the vote-thanking activities together, from the past to the present, Hong Kong filmmakers have shown the spirit of unity and forge ahead under the Lion Rock.



Overseas blockbuster top the chart Hong Kong film market for many years, "tomorrow’s war" and "still think you are the best" outstanding performance, shows that Hong Kong-made films are returning to the Hong Kong audience’s vision, the two films are far from enough to sell, Hong Kong film market to reproduce the 80, 90’s brilliant scene, but also need more good stories, more new breakthroughs.


"In the car we made ourselves!"

The cornerstone of the First Automobile Factory engraved with Mao Zedong’s inscription

In May 1958, China’s first "Dongfeng" brand car was successfully trial-produced

In the early days of the founding of New China, Mao Zedong said: What can we make now? We can make tables and chairs, tea bowls and pots, grow grain, grind flour, and make paper, but we can’t make a car, an airplane, a tank, or a tractor.

Achieving socialist industrialization is a natural requirement and a necessary condition for a country to become independent and prosperous, and is the foundation and premise for building a modern socialist power. During the "First Five-Year Plan" period, the state concentrated its resources to establish an independent and relatively complete industrial system and national economic system in a short period of time, achieving rapid growth of the national economy, which was of far-reaching significance to China’s later industrial development.

The cornerstone of the "First Automobile Factory Groundbreaking Memorial" displayed in the History Exhibition Hall of the Communist Party of China, inscribed by Mao Zedong, is 120.5 centimeters long, 70 centimeters high, 5.5 centimeters thick, and weighs 250 kilograms. The texture of white marble is an important witness to the history of industrial construction in New China.

On June 15, 1953, Mao Zedong delivered a speech at the Politburo meeting of the Central Committee, formally proposing the general line for the transition period. Faced with the lack of funds, technology and talents, to establish China’s own industrial system, it is necessary to formulate detailed plans and concentrate the limited human, material and financial resources to build a number of urgently needed major projects.

Under the personal guidance of Mao Zedong and the direct help of the Soviet Union, the first five-year plan was formulated by Zhou Enlai, Chen Yun, Li Fuchun, etc., and the strategic decision to give priority to the development of heavy industry was made. Adhering to the policy of "self-reliance first, and foreign aid as a supplement", the preliminary industrial layout was completed. During the "First Five-Year Plan" period, a total of 694 large and medium-sized construction projects were arranged, and 921 were actually constructed, including 156 construction projects aided by the Soviet Union, focusing on the development of heavy industry, energy, raw materials, machine manufacturing and other basic industrial projects.

In 1953, the People’s Daily published a New Year’s Day editorial announcing that China had begun to implement the first five-year plan, calling on the people of the whole country to work together with one heart and one mind and actively strive for the realization of industrialization. Building a prosperous and strong modern industrial country is the dream of several generations of Chinese sons and daughters. Faced with the "poor and white" family background and the heavy blockade in the world, the Chinese people have a common dream, a foothold in the sky, and energy. Facing difficulties, the Chinese people have carried out large-scale industrial construction in full swing across the country.

As early as Mao Zedong’s first visit to the Soviet Union, he visited the Stalin Automobile Factory. At that time, he pointed to the cars that drove down the assembly line and said to his entourage: "We also want to have such a large factory!" On July 15, 1953, the first automobile industrial base of New China, Changchun First Automobile Factory, held a groundbreaking ceremony in a barren suburb of Changchun. Mao Zedong personally wrote the cornerstone inscription. Instead of adopting the proposed "Mao Zedong Automobile Factory" or "New China Automobile Factory", he named it the First Automobile Factory because he said: "We will soon have a second and a third."

600 million yuan was invested in the construction of the FAW, which is equivalent to one yuan for 600 million people in the country. On July 13, 1956, we forcefully announced that the first car in New China was successfully trial-produced. "From today onwards, the history of China’s inability to manufacture cars is over, and our own cars will be driven out of here more and more day by day." Mao Zedong personally picked up the pen and wrote the word "Liberation". The first batch of 12 "Liberation" brand cars drove off the assembly line and became an eternal and precious freeze frame in the history of the Republic. The rejoicing masses, as the song made up at that time sang: "Looking forward to the stars and the moon, the domestic car that I hoped for really left the factory." Just one year later, Changchun FAW completed the production of 4,000 vehicles stipulated in the first five-year plan six months and five days ahead of schedule.

In 1958, the Changchun FAW Factory produced China’s first domestically produced car, the Dongfeng brand car. After the manufacture was completed, it was instructed by the central government to be shipped by train to Beijing. When it drove off the platform, it was almost unable to leave the Beijing Railway Station due to the enthusiastic crowd competing to watch. Dongfeng originated from Mao Zedong’s famous statement on the international situation – "Dongfeng overwhelms the westerly wind". The word "Dongfeng" on the front of the car was originally Chinese pinyin. On the eve of the Dongfeng car arriving in Beijing and driving into Zhongnanhai, according to the suggestion of the then director of the General Office of the Central Committee ***, in order to highlight the cars produced by the Chinese themselves and replace them with Chinese characters, FAW staff went to the People’s Daily overnight to photocopy Mao Zedong’s original handwriting of "Dongfeng overwhelms the westerly wind". It was replaced in an auto repair shop in Dengshikou, and a golden dragon was about to be vacated in the front of the car, which was very Chinese. Mao Zedong took it in person and said happily: "We took a car made by ourselves!"

While the automobile industry was booming, various industrial categories were also in full swing. On December 26, 1953, the three major projects of Angang, consisting of a large rolling mill, a seamless steel pipe plant, and a No. 7 blast furnace, were completed and put into operation. At the same time, new steel production bases were deployed, and a new layout of the steel industry in New China was initially formed. The petroleum industry, chemical industry, and weapons industry have all achieved a certain degree of development, focusing on the construction of emerging industrial sectors such as aviation and electronics, and the creation of new cutting-edge industries in the nuclear and aerospace industries. In 1956, Shenyang Aircraft Factory produced the first new jet fighter; in 1958, the first Dongfanghong tractor was born in the first tractor factory located in Luoyang City… In that fiery construction era, China, which used to import iron nails and matches, achieved one zero breakthrough after another, and gradually established an industrial economic system under the leadership of the socialist state-run economy, which made our country’s industrial economy recover and develop rapidly under extremely difficult conditions.

Today, steel dragons meander vertically and horizontally, phoenixes spread their wings at Daxing Airport, Chang’e Tiangong catches the moon in nine days, and flood dragons and snow dragons catch turtles in five oceans. Over the past 70 years, China’s industry has achieved one "zero breakthrough" after another, and Chinese manufacturing and Chinese creation are gradually leading the world.

(History Exhibition Hall of the Communist Party of China, contributed)

Beijing online car-hailing market bid farewell to foreign cars, non-Beijing owners: rice bowl gone

  Beijing, April 2 (Reporter Ma Chuang) According to the Voice of China "News Vertical and Horizontal" report, after Didi stopped sending orders to non-Beijing brand vehicles in the Third Ring Road last Monday, from yesterday (1st), Didi stopped sending orders to non-Beijing brand vehicles throughout Beijing. Data show that after the implementation of the new policy, Beijing’s standard online car-hailing will drop to 10% of the previous. In the face of Didi’s new policy, how do non-Beijing car owners who do not meet the requirements respond? In the face of concerns about "whether it will return to the difficulty of hailing a taxi", what new measures will Didi take?

  On March 20, Didi stopped sending orders to non-Beijing brand vehicles in Beijing’s Third Ring Road. Nine days later, Didi sent a notice to drivers on the client side, announcing that it would stop sending orders to non-Beijing brand vehicles throughout Beijing from April 1.

  Didi Chuxing staff said that the successive adjustments to the policy were to implement the relevant regulations in the Beijing online car-hailing rules. "According to the regulations of the Beijing online car-hailing rules, Didi will stop sending orders to the whole Beijing area, including those outside the Sixth Ring Road, before April 1."

  Some non-Beijing drivers have started looking for new jobs after the new rules were issued. Didi suggested that non-Beijing drivers go back to the place where the license plate belongs to continue to take orders, or participate in the recycling of used cars, discounted car purchases, and discounted car rental schemes. Some non-Beijing car owners expressed difficulty in this regard. "Sending a message is like an advertisement, which will definitely affect the driver, because my job is gone, I plan not to run, there is no way. There is definitely no business going back to the local area, and I will not recycle the newly bought car."

  In December last year, the Beijing Municipal Transportation Commission and other departments jointly issued the "Detailed Rules for the Administration of Online Booking Taxi Business Services in Beijing", requiring that online car-hailing must be "Beijing people drive Beijing cars". At that time, Beijing gave a five-month transition period to facilitate drivers and online car-hailing platforms that meet the standards to submit applications and accept assessments. According to the regulations, engaging in online car-hailing services requires participating in national and local exams. Only after passing can you register for employment, and the valid period for registration of professional qualifications is 3 years.

  Although the exam questions were generally not difficult, Master Wei, the driver, said that he was a little unable to take the exam. "If you want to drive, you must first get a license, and you must take the online car-hailing driver’s license and service license. How can we pass the exam? If you ask me to participate, I will not participate."

  Didi’s new policy may be difficult for non-Beijing car owners to buy it. Zhu Wei, deputy director of the Communication Law Research Center of China University of Political Science and Law, said that although the implementation of the new policy may lead to some contradictions at the beginning, in the long run, the Internet sharing economy is still the general trend. "In the future, the market supply and demand may be unbalanced, and the supply will continue to decrease while the demand is still very large, so the price may rise in a short period of time, and it is very likely that you will not be able to get a car. This is the negative impact of the implementation of the new policy. At present, the sharing economy has just emerged. Including the friction between traditional industries and the sharing economy, it may require legal regulation. Conservatively speaking, it may be conducive to social stability."

  After Beijing stopped sending orders to non-Beijing-licensed vehicles, how are the current business conditions of online taxi drivers and taxi drivers who meet the standards? Many people are worried that they will face the problem of difficult taxi hailing again in the future. How will Didi respond to this?

  According to media reports, previously in Beijing, about half of the online car-hailing vehicles operated by foreign license plates used to account for about half. Now, coupled with the requirements of vehicle wheelbase, license plate and household registration, it is estimated that the online car-hailing cars that meet the requirements may only account for 10% of the current stock. Didi staff said that there will be new ways to deal with it in the future. "Since the reduction of transportation capacity may affect the success rate and waiting time of users in some areas and some times, we apologize for this. At the same time, we have also taken various measures to improve efficiency and hope to meet user requests as much as possible."

  In Beijing, many passengers have already felt that it is becoming more and more difficult to order a car. Some industry insiders believe that the impact of Didi’s suspension of foreign-brand cars will be felt soon, and this part of the impact will be mainly on express and special cars. Unlike the worried non-Beijing-brand drivers, many "Beijing-brand" online car-hailing drivers who meet the detailed regulations are full of expectations for the future. "Suddenly there are not so many cars, can you not live much? These days, it is obvious that there is more life, but the delivery distance is far. It is time for Didi to start promoting and rewarding drivers, which is the key."

  Some Beijing taxi drivers believe that the new method of dispatching orders will ease traffic congestion to some extent. "Big cities are already very congested, and traffic in Beijing will be much better after the new policy. It is long overdue to stop them. At that time, the review will be very strict, and it will definitely be safe. Taxi companies are also in the background, and they are all safe to a certain extent. It is difficult to say whether private cars are safe or not."

  With the implementation of the new policy, only 10% of the stock of online car-hailing that meets the standards is left, which may not pose a threat to the traditional taxi market for the time being, and taxi companies do not have to exclaim "the wolf is coming" as before. As for the future development of online car-hailing, Zhu Wei said that the only thing left is to carry out refined operations in the public sector, and ways such as ride-hailing, data economy, and cooperative entrepreneurship may inject new blood into the online car-hailing industry. The development speed may not be as fast as in the past, but deep cultivation under the legal framework is the only way to consolidate the foundation of the enterprise.

  Zhu Wei analyzed that the first way to develop more is to add more hitchhikers, because the current proportion of hitchhikers may be relatively small, and their own vehicles, fixed routes, and usually can bring a few more people. This kind of behavior may exist in large numbers in the future, and it is also worth encouraging. The second is the data economy. Under the current model of the sharing economy, including vehicle information and vehicle route information, it must be counted in the big data platform of smart travel and smart cities. In the future, Didi will integrate and communicate data with the government and taxi companies in this regard, and there will be many good directions for the entire Beijing travel in the future. Third, Didi will have some travel, including a business plan to cooperate with drivers. At present, Didi, including the implementation measures for the implementation of the new policy in the future, must take the current law as the bottom line. If there are new situations and new problems when "Internet +" develops in the future, the country may further refine it, and there may be changes in legislation and law enforcement.

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  The Altay Mountain Ice and Snow Tourism Belt, which is dominated by Altay region, is located in the northernmost part of Xinjiang. Altay is known as the "origin of human skiing", and the snow season can reach 7 months throughout the year, which is very suitable for carrying out ice and snow sports.

  Starting from the snow season in 2021, Peng Chao, a senior snow friend from Beijing, rented a wooden house in Hemu Village, deep in Altai Mountain, Xinjiang, as the team’s work site in the next few years. The team mainly carries out skiing equipment evaluation and popular science skiing knowledge, and is well-known among domestic skiers. Peng Chao said that Altay region is located in the world’s ice and snow resources ‘ Golden latitude ’ All the natural advantages of other international ski resorts are available here. During his stay in Hemu, he and other members of the team promoted the knowledge of avalanche risk avoidance and advocated the concept of safe and sustainable mountaineering and skiing.

  This is a photo taken on January 12, 2023 at Hemujikplin Ski Resort in Altay, Xinjiang (photo of drone).

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency (photo by yue hu)

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

Xinhua All Media+Sports Geography | In Altay, pursue the original dream of human skiing.

  With the advantages of long snow period, good snow quality and diverse terrain, Xinjiang has built a number of high-standard ski resorts, forming two major ice and snow tourist belts, Tianshan Mountain and Altai Mountain, which are popular areas for ice and snow sports in China.

  Xinhua News Agency reporter Hu Huhu photo

List of must-play games in 2022. What stand-alone games can’t be missed this year?

This content comes from @ What is worth buying APP, and the opinions only represent the author himself | Author: Lone Star Tears

The year 2022 has come to an end, and this year’s games have also been sold. Generally speaking, it is a relatively calm year. The top-quality games like 3A masterpieces have emerged one after another, and there are many transplanted games on various platforms. If you are a steam player, it’s really fun. The following is a list of stand-alone games that must be played this year. Please check it out.

Best of the year, I didn’t expect to be able to play in March until December. I thought the interest in the wilderness could be compared but it was postponed, so Hidetaka Miyazaki won another award of the year and won! To tell the truth, the Elden ring that has been polished for so long is also worthy of the name. The game experience of the open soul world is not weaker than that of the wilderness. Well, the bug numerical balance has also been fixed, and we can look forward to the launch of DLC.

The God of War was expected by many people before its launch, but after its release, its reputation was uneven, mainly because the black people in the west were too correct to ruin the game experience. More importantly, bilibili UP sent a 30-minute video denouncing the boring plot for ruining the game. When the firepower was so fierce, it had to be the last time "The Last Survivor 2" was released.

Putting aside the boring correctness, this sequel continues the regular gameplay of the last one, with high-definition image quality and semi-open world design. The degree of innovation is not much, the monster repetition rate is high, and the plot pit is not filled enough. It’s a bit like the feeling of a large DLC in the last one, but it’s still fun, and it’s a qualified 3A masterpiece anyway.

After the release of Plague Legend 2, the word-of-mouth rose linearly, and the previous work received rave reviews. This work brought a novel experience to the players, much better than Ares 5. Well, it’s no problem to rank second in the year, although this IP is quite new, but the game industry is always talking about strength.

The plot follows the previous one. This time, I fled in the picturesque French scenery. Each character has unique skills, and the rats are even more shocking. Chinese dubbing and beautiful soundtrack add gameplay, and later it changed from historical color to magical color. The conversion is a bit true, but overall, it is fun and must be played!

This year, two new year’s treasure dreams were sold. At the beginning of the year, Arzeus and November Zhu/Zi got a good evaluation unexpectedly. As long as they are not too shoddy, fans will accept this series of treasure dreams. Both of them adopt the open world gameplay and take risks in a world full of treasure dreams. This novel experience is still very good. From the sales volume, it can be seen that fans really take this set.

It’s a must-play, but it’s only for fans or players who like this kind of pet collection. In addition, these two works are exclusive versions of switch, and you have to have a switch to play.

It’s a pretty good independent boutique game. The gameplay is against games such as Hades and action Roguelite. Every death will inherit new features, which is reflected in the game that the characteristics of future generations are strengthened. Each future generation has different skills or attributes. Experience new equipment and new skills in the brush, and you can’t stop playing for a few minutes or more. Compared with the previous work, this second generation has richer level design, more diverse occupations and skills, and a variety of upgrade systems. You can explore and try it again and again, and it is an excellent work in general.

A boutique stand-alone jrpg game produced by an independent game developer with a humble budget is simply a horizontal version of the game. The score on the game website is as high as 9.7 points. No matter the plot, music, art or gameplay are carefully polished, the overall play is a kind of cool feeling of playing PSP clearance games when I was a child, which is very nostalgic! This game is considered as a dark horse this year. Although it is unpopular, its quality is extremely excellent. Support it and you must play it!

Follow-up: This year, some games, such as The Lost Light 2, The Desperate Horizon to the West and Sniper Elite 5, are also high-quality games, but they are not listed due to the limitation of space. With the support of some domestic games, Taiwu Huajuan and most of them are quite good-quality games produced this year. The transplanted fun games include Triangular Strategy, Two-person Tour, and Exotic Record of Goddess 5.

The author declares that there is no interest in this article, and welcomes rational exchange and harmonious discussion among value friends ~

Drogba celebrated his 45th birthday, and Blue Bridge won the title and helped Chelsea win 12 important trophies.

Live broadcast: On March 12th, Drogba celebrated his 45th birthday. The official Chelsea media showed a cartoon of Drogba bringing back the big ear cup for the Blues and sent birthday wishes to the legendary star.

Chelsea’s official social media wrote: "We hope you had a happy birthday."

Drogba played for the Blues twice before and after, and scored 157 goals for Chelsea in 341 games during his first time. In 2014-15, Drogba returned to Stamford Bridge and won the fourth Premier League title in his career. In addition, during his time at Chelsea, Drogba also won four FA Cup titles and three Carling Cup titles. What is important is that in 2012, Drogba helped the Blues beat Bayern and won the first Champions League trophy in the team’s history.

(Sky)

President china portrait photography society and his party visited Meitu Company for a discussion.

Recently, Mr. Yan Taichang, Chairman of china portrait photography society, Mr. Han Yuezhi, Vice Chairman of china portrait photography society and Chairman of Post-production Professional Committee, Mr. Liang Jiande, Vice Chairman of china portrait photography society and Chairman of Cosmetic Modeling Professional Committee, and their delegation visited Meitu Company for exchange and discussion. Also present at the visit and discussion were Xu Chunsheng, Chairman of Platinum Jue Travel Photography Culture Group Co., Ltd., and Pan Baofu, founder of Extraordinary 6+1 Photography Group. Zheng Minglie, Chairman of Wiener Digital Printing Art Industrial Park, He Songlin, Senior Vice President of Meitu Company, Chen Jianyi, Vice President of Products and Xu Qingquan, Head of Meitu Yunxiu, accompanied him to visit and attend the symposium.

In the exhibition hall of Meitu Company, Chairman Yan Taichang and his party learned about the development history, company strategy, corporate culture, product innovation, core technologies and honors of Meitu Company in detail, and experienced the software and hardware products of Meitu, such as Xiu Xiu, Beauty Camera, Wink, Meitu Skin, etc. On the spot, they paid attention to and recognized the innovative products and leading imaging technologies of Meitu Company. During the introduction of Meitu’s corporate strategy, Chairman Yan Taichang and his party learned deeply that at present, Meitu, based on its image core competence, digs more scenes at the C-end, while focusing on the B-end market with SaaS and related businesses as its main focus. Based on Meitu’s continuous investment in scientific and technological innovation, accumulated grasp of the public’s aesthetics over the years, and understanding of the needs of a large number of users, Meitu Yunxiu, a one-stop intelligent retouching solution for the commercial photography industry, is launched. In this regard, Mr. Yan Taichang said that the imaging technology mastered by Meitu can solve the technical problems existing in the portrait photography industry in a targeted manner, and help photographers, retouchers and enterprises to improve retouching efficiency with the help of artificial intelligence technology, and help the standardization construction and digital transformation of the industry.

At the symposium, the two sides had an in-depth sharing and exchange on the current situation, pain points and future development direction of portrait photography industry. With the consumption upgrade of portrait photography industry, all enterprises are facing new opportunities and challenges. Both sides said that since the formal strategic cooperation was reached, through multi-field and high-level in-depth cooperation, more and more photographers and enterprises actively embraced the digitalization of portrait photography, and jointly explored and developed the digital economy with Meitu Yunxiu. "Technology" and "digitalization" are the key words for the development of portrait photography industry. Focusing on china portrait photography society’s leading role in the industry, Meitu Yunxiu will give full play to its technical advantages in the field of imaging technology, actively promote the continuous deepening of cooperation between the two sides, focus on overcoming the shortcomings of the industry, rely on image AI technology, jointly promote the high-quality development of portrait photography industry, and serve high-quality post-retouching to help portrait photography. Help the upstream and downstream industries to realize all-round digital transformation and upgrading. The head photography brands and later brands who participated in this symposium all said that intelligent retouching technology can actually help enterprises reduce costs and improve efficiency, and imaging technology is playing an increasingly important role in portrait photography ecology. Therefore, we should work together to seize the opportunities of digital development, promote the development of new businesses in various fields of the industry, create new formats, explore new modes, and make greater contributions to the digital transformation of portrait photography.

The person in charge of Meitu Yunxiu said that as one of the important strategies of Meitu’s B-end layout, Meitu Yunxiu is committed to promoting the high-quality development of portrait photography industry and serving high-quality post-retouching. Relying on the continuous breakthrough and innovation of imaging technology, Meitu Yunxiu will launch the first multi-terminal adaptation mode in the industry, flexibly adapt to complex equipment and network environment, and provide better and more convenient intelligent retouching services for enterprises and retouchers, helping enterprises achieve cost reduction and efficiency increase.

Since the two sides reached a strategic cooperation in 2022, based on the multi-dimensional cooperation between online and offline, the two sides have achieved a lot. As a strategic partner of china portrait photography society, Meitu Yunxiu will give full play to its advantages in imaging technology and artificial intelligence, further deepen cooperation with china portrait photography society, promote the digital and intelligent development of portrait photography industry, and comprehensively help accelerate the development of digital economy of portrait photography industry in China.

I put the essence of Python coroutine Pa was clean!

This article is a large amount of information, from IO multiplexing, to use the generator, then async, await realization of the principle behind it, in simple terms, the analysis was very thorough, very hardcore!

Two days for personal reasons because it did not touch a long time to write a point of Python, which involves "coroutine" program, the last time out, it is Web framework tornado unique feature, now we have async, await keyword support . Thought about its implementation, reviews the evolution of these years, feel a little bit mean.

They are single-threaded, why the original code with the low efficiency of the async, await add some asynchronous library becomes higher efficiency?

They are single-threaded, why the original code with the low efficiency of the async, await add some asynchronous library becomes higher efficiency?

If you do Python-based network or Web development, this question has puzzled, this article attempts to give an answer.

Before beginning 0x00

Firstly, Not take you browse the source codeAnd then tell you the control to achieve the original code Python standard. Instead, we will set out from the real problems, think of solutions to the problem, step by step evolution path experience solutions, and most importantly, hoping to gain knowledge in a systematic upgrade process.

This article only provides an independent direction of thinking, does not follow the historical and current actual implementation details.

Secondly, you need to read this article familiar with Python, at least understand the concept generator generator of Python.

0x01 IO multiplexing

This is the key to performance. But we are here only to explain the concept, its implementation details is not the point, which we understand Python coroutine enough, as already know enough about, advances to 0x02.

First, you want to know all the network service program is a huge loop, your business logic can be called at some point in this cycle:

defhandler (request):

WHILETRUE:

# Get a new request

request=accept

# To get users to write business logic function according to the route map

Handler=GET_HANDLER (Request)

Handler (Request)

Imagine your Web service of a handler, after receiving a request requires a response to the results of API calls.

For the most traditional network applications, your API requests issued to wait for a response after this time the program stops running, even new requests have to get in after the end of the response. If you rely on an API request packet loss seriously, especially in response to slow it? That will be very low throughput applications.

Many traditional Web server using multi-threading technology to solve this problem: the run handler is placed on other threads, each dealing with a request, this does not affect the new thread blocks request to enter. This problem can be solved to some extent, but for larger systems concurrent, multithreaded scheduling will bring significant performance overhead.

IO multiplexing can be done to solve the problem without the use of threads, it is provided by the operating system kernel functions, we can say specifically for this type of scenario for us. Simply put, your program encounters network IO, tells the operating system to help you staring at, while the operating system gives you a way to make you can feel free to get what IO operation has been completed. like this:

# # 操作 系统 复 复 示 示 例 代代

# Register the ID and type of IO operations to the operating system IO

IO_REGISTER (IO_ID, IO_TYPE)

# Get completed IO operations

Events=IO_GET_FINISHED

For (IO_ID, IO_TYPE) INEvents:

IFIO_TYPE==Read:

Data=read_data (IO_ID)

Elifio_Type==Write:

Write_data (IO_ID, DATA)

Gring the IO multiplex logic into our server, probably like this:

Call_backs={}

Defhandler (REQ):

# do jobs here

DefCall_back (Result):

# Use the returned Result to complete the remaining work …

Call_backs [IO_ID]=CALL_BACK

# New cycle

WHILETRUE:

# Get the completed IO event

IFIO_TYPE==Read: # read

Data=read (IO_ID)

Call_back=call_backs [io_id]

Call_back (data)

Else:

# Other types of IO event processing

PASS

# Get a new request

Handler (Request)

Our Handler has returned immediately for the IO operation. At the same time, each iteration will perform a callback over the completed IO, the network request no longer blocks the entire server.

The pseudo code above is only for understanding, and the details are more complicated. Moreover, it is also possible to connect the new request to the IO event from the operating system to the monitor port.

If we split the cycle part with a call_backs dictionary to a separate module, we can get an EventLoop, which is the iOLOOP provided in the Python Standard Library Asynci.

0x02 with generator to eliminate Callback

He focuses on the Handler function written in our business, after having independent iOLOOP, it now becomes like this:

# 业 业 代 代 … …

# Need an API request

Print (Result)

ask_LOOP.GET_EVENT_LOOP.IO_CALL (API, CALL_BACK)

Here, performance problems have been resolved: We no longer need multi-threads to constantly accept new requests in the source, and don’t have to rely on the API response.

But we have also introduced a new problem. The original business logic code is now demolished. The code before requesting the API is still normal. The code after the request API can only be written in the callback function.

Here our business logic has only one API call. If there are multiple APIs, plus the call to Redis or MySQL (their essential is also a network request), the entire logic will be split, this is a burden on business development .

For some languages ??with anonymous functions (right is Java), it may also trigger a so-called "turning hell".

Next, we find way to solve this problem.

We can easily think that if the function can be suspended after running to the network IO operation, it will wake up at the breakpoint after completion.

If you are familiar with Python’s "Builder", you should find that it happens to have this feature:

Defexample:

Value=yield2

Print ("Get", Value)

ReturnValue

g=esample

# 启 启 生器, we will get 2

Got=G.send (NONE)

Print (got) # 2

TRY:

# Anti-start will display "get 4", which is our incoming value

Got=g.send (got * 2)

ExceptStopItemization ASE:

# Builder runs, will print (4), E.Value is the value of generator return

Print (E.Value)

There is Yield keyword in the function, and the call function will get a generator, and a key method for generator can interact with the generator.

G.send (none) runs the generator code until you encounter Yield, and return to the object, that is, 2, the generator code is stopped here until we perform G.send (got * 2) again, The 2 * 2 is also 4 to assign the value Value in front of Yield, and then continue to run the generator code.

Yield is like a door, you can send a thing from here, you can also take another thing.

If Send makes the generator to run until the next yield is over, the Send call will trigger a special exception STOPITERATION, which comes with a property Value, which is the value of the generator Return.

If we convert our Handler to a generator with Yield keyword, run it to The specific content of IO operationReturns, put the IO result back and restore the generator to run, then solve the problem of uncomfortable business code:

# 业 业 代 代 … …

# Need to execute an API request, directly put the IO request information yield

Result=yieldio_info

# Use the result returned by the API to complete the remaining work

Print (Result)

# This function is registered in iOLOOP, used to call back when there is a new request

Defon_Request (request):

Handler=GET_HANDLER (Request)

g=Handler (Request)

# 首 首 启 获得 获得 i 获得

IO_INFO=G.send (none)

g.send (Result)

ask_LOOP.GET_EVENT_LOOP.IO_CALL (IO_INFO, CALL_BACK)

The above example, the Handler code written by the user will not be dispersed into the callback, and the ON_Request function interacts with Callback and IOLOOP, but it will be implemented in the web framework, which is not visible to the user.

The above code is enough to give us inspiration of Callback destroyed with the builder, but there are two points:

  1. Only a network IO is initiated in business logic, but it is often more

  2. Business logic does not call other asynchronous functions (helping), but in practice, we tend to call other levels.

Let’s take a more complex example:

Among them, Request executes real IO, FUNC1, FUNC2 is only called. Obviously our code can only be written:

Deffunc1:

Ret=yieldfunc2 (re)

returnret

Deffunc2 (DATA):

ReturnResult

DEFREQUEST (URL):

# This simulation returns an IO operation, contains all information about the IO operation, where the string is simplified

Result=yield "IOJOB OF% S"% URL

ReturnResult

For Request, we expose the IO operation to the framework through Yield.

for Func1 and func2, calling request, clearly add Yield keywords Otherwise, the request call returns a generator and will not be paused and continue to perform subsequent logic obviously errors.

This is basically that we don’t write asynchronous code in the Tornado framework without Yield from, Aysnc, AWAIT.

To run the entire calling stack, the approximate process is as follows:

  1. Call FUNC1 to get the generator

  2. Call Send (None) Start it gets the result of request ("http://test.com/foo"), or generator object

  3. Send (none) Starts the generator generated by the request, gets the IO operation, registered by the frame to IOLOOP and specify a callback

  4. The Request Builder wakes up in the callback function after IO, and the generator will go to the return statement end

  5. Capture an exception to get the return value of the Request Builder, wake up the last layer of FUNC1, and get a FUNC2 generator

  6. Continue to execute …

Call FUNC1 to get the generator

Call Send (None) Start it gets the result of request ("http://test.com/foo"), or generator object

Send (none) Starts the generator generated by the request, gets the IO operation, registered by the frame to IOLOOP and specify a callback

The Request Builder wakes up in the callback function after IO, and the generator will go to the return statement end

Capture an exception to get the return value of the Request Builder, wake up the last layer of FUNC1, and get a FUNC2 generator

Continue to execute …

Friends who are familiar with the algorithm and data structure encounter such a traversal logic that will be returned, can be recursively used, because the recursive use generator can not do it, we can use the stack, in fact, this is the word "call stack" origin.

With the stack, we can Connect all generators connected in series in the entire call chain to a generatorFor its constant Send, you can continue to get all IO operation information and drive the call chain advancement, and the implementation method is as follows:

  1. The first generator is in the stack

  2. Call the Send, if you get the generator, you will enter the next round iteration

  3. I encountered IO to ask Yield, let the frame sign up to iOLOOP

  4. After the IO operation is completed, the cache result is forth, enter the next round iteration, the purpose is to restore the upper function using IO results.

  5. If a generator is running, you also need to restore the upper function to the upper function.

The first generator is in the stack

Call the Send, if you get the generator, you will enter the next round iteration

I encountered IO to ask Yield, let the frame sign up to iOLOOP

After the IO operation is completed, the cache result is forth, enter the next round iteration, the purpose is to restore the upper function using IO results.

If a generator is running, you also need to restore the upper function to the upper function.

If implemented, the code is not long but the amount of information is relatively large.

It turns the entire call chain to a generator, calling the send, to complete the IO in the chain, complete these IO, continue to push the logic execution in the calling chain until the overall logic ends:

DEFWrapper (GEN):

# The first layer calls the stack

Stack=stack

Stack.push (gen)

# Start a layer-by-layer call

WHILETRUE:

# Get the top elements of the stack

item=stack.peak

Result=none

IFisgenerator (item):

TRY:

# Try to get the next layer call and get it in the stack

Child=item.send (Result)

Stack.push (child)

# Result Restore to NONE

Result=none

# After entering the stack, enter the next loop directly, continue to explore down

Continue

# If you have an end, you will temporarily save the Result, the next step to make yourself out.

Result=E.Value

Else: # o o operation

# # I 操作 操作, Yield, Io will be woken up and temporarily saved after IO

Result=yieldItem

# 走 到 here, this layer has been completed, out of the stack, the next iteration will be a layer of calling chain

Stack.pop

# 没有有 上, the entire call chain is completed, return

Ifstack.empty:

Print ("finished")

ReturnResult

This may be the most complicated part. If you look hard, it is actually as long as you understand that for the call chain in the example above, it can achieve the effect as follows:

W=Wrapper (Func1)

# Will get "IOJOB of http://test.com/foo"

W.send (none)

# 上 上 ojob foo completed the result "bar" incompart, continue to run, get "IOJOB OF http://test.com/bar"

W.send ("bar")

# 上 上 i i b 完成 完成 传 传 传 传 入 入 入 入 入 入 入 入 入 入 入 入 入

W.send ("BARZ")

With this part, the frame will be added to the matching code:

# Maintain a list of ready lists, store all completed IO events, format is (Wrapper, Result)

Ready=

# After using the wrapper package, you can process IO by Send.

g=wrapper (func1)

# Take the start state directly as the result of NONE

Ready.Append ((g, none))

# Let the iOLOOP perform this function each cycle to handle the ready for IO

Ready.Append ((g, result))

# Traversing all already generators, advance it down

Forg, Result InselF.Ready:

# Use the Result to wake the builder and get the next IO operation

IO_JOB=G.send (Result)

# After the IO operation is complete, add the generator to the ready list, wait for the next round of processing.

ask_LOOP.GET_EVENT_LOOP.IO_CALL (

IO_JOB, LambdareSult: Ready.Append ((g, result)

Here, the core idea is to maintain a list of ready-to-read, and IOLOOP is overwhelmed, and the generator that promotes the ready state is run down, and the new IO operation is registered. After the IO is completed, the ready, after several rounds of Ioloop iteration A Handler will eventually be executed.

At this point, we use the generator to write to write business logic to run normally.

0x04 Improved Scalability

If you can read it here, Python’s scope is basically clear.

We have already achieved one Miniature sweeping frameworkThe realization details of the standard library look great here, but the specific ideas are consistent.

Our equilation framework has a restriction, we can only use IO to operate asynchronously, although in the world of network programming and web programming, the block is basically only IO operation, but there are some exceptions, such as I want the current operation Sleep for a few seconds. The use of time.sleep will make the entire thread to block, requiring special implementation. For example, some CPU-intensive operations can be asynchronously through multi-threaded asynchronous, so that another thread notification event has been completed and followed.

Therefore, it is best to decouple an open space with the network, so that the network IO is only one of the scenes, improves the scalability.

The Python official solution is to let the user hand to block the block code. As for the IOLOOP to register IO event or open a thread completely by yourself, and provide a standard "placeholder" FUTURE, indicating that his results wait for the future Yes, some prototypes are as follows:

ClassFuture:

# Set the result

Defset_Result (Result): Pass

# 获取 结果 结果

Defresult: Pass

# 表示 表示 This Future object is not already set up.

Defdone: Pass

# Set the callback function that should be executed when he is set, you can set multiple

Defadd_done_callback (Callback): Pass

Our slight change can support Future, making the scalability stronger. Network request functions for user code:

# 现在 r es es,, 生 生 器 器 器 器 器 器 器 器

#future is understood as a placeholder

Fut=future

Defcallback (Result):

# Assign the placeholder when the network IO completed the callback

Fut.set_Result (Result)

ask_LOOP.GET_EVENT_LOOP.IO_CALL (URL, CALLBACK)

Now, Request is no longer a generator, but directly returns Future.

And for the function of processing the ready list in the frame:

DEFCALLBACK (FUT):

#future is set to be placed in the ready list

Ready.Append ((g, fut.result))

Fut=g.send (Result)

Fut.add_done_callback (callback)

0x05 development and change

Many years ago, when using Tornado, probably only one Yield keyword is available, the sweeper wants to achieve, that is, this idea, even Yield keywords and return keywords can not appear in a function, you want to run after the generator Returns a value, you need to manually Raise an exception, although the effect is the same as Return now, but it is still very awkward, not elegant.

Later, there was Yield from expression. What can it do?

It is popular, it is done what the generator Wrapper is doing the above: Calling link through the stack, it is the syntax of the Wrapper logic.

With it, the same example you can write:

Deffunc1:

# Note Yield from

Ret=yieldFromRequest ("http://test.com/foo")

# Note Yield from

Ret=yieldfromfunc2 (re)

returnret

Deffunc2 (DATA):

# Note Yield from

Result=yieldfromRequest ("http://test.com/"+data)

ReturnResult

# 同 上 上 实 实 实 实 实 r

Then you no longer need the brainless Wrapper function:

g=func1

# Return the first request for Future

g.send (none)

# Continue to run, automatically enter FUNC2 and get the FUTURE inside it

G.send ("bar")

# Continue to run, complete the residual logic of the call chain, throw the stopiteration exception

G.send ("BARZ")

Yield from the entire call chain directly, it is already great, but it is used asynchronous programming or otherwise, and other languages ??have special-top Async, the AWAIT keyword, until the later version puts these content With dedicated Async, AWAIT keyword packaging, it is a more elegant look today.

0x06 summary and comparison

Overall, Python’s native and trip is achieved from two aspects:

  1. Based on IO multiplexing technology, the entire application is non-blocking on IO, achieving high efficiency

  2. Change the dispersed Callback code through the generator into synchronous code, reducing business writing difficulties

Based on IO multiplexing technology, the entire application is non-blocking on IO, achieving high efficiency

Change the dispersed Callback code through the generator into synchronous code, reducing business writing difficulties

There is a language of the object of the generator. Its IO fight is achieved, the evolution of the Java fight is basically exactly, the keyword is the same, and the Future class is the same than the promise.

However, it is different for this, which is different from this sweeping with the degree of GO-named GO, and does not explicitly based on the generator.

If the class ratio, you can implement the geventime of Python, which is the runtime, and Patch off the system calls to access your own Runtime, you come to the scheduling sweeper, gevent is focused on the network, based on network IO scheduling, relatively simple, The GO achieves perfect multi-core support, more complex and perfect, and creates a new CHANNEL new programming paradigm.

Author: Mao bean peanut

Getting Started: The Most Complete Zero-Basic Python Problem | Zero-Based 8 Months Python | Battle Project | Learning Python is this shortcut

Dry goods: crawling Douban short comment, movie "later we" | 38 years old NBA best player analysis | From Wanzhong to Word! Tang Dynasty 3 disappointment | Laughing to see the new Eti Dragon Slay Dollar | Running Question King | Make a massive Miss in Python Sketch | Disc, I am so fire, I use machine to learn to be a mini recommended system movie

Fun: Poultry Game | Nine Mao Hai | Beautiful Flower | Two-Article Python "Everyday Cool" game!

AI: Robot that will be poetry | Give the picture color | predictive income | Solver, I use the machine to learn to be a mini recommended system movie

Gadget: PDF to Word, easy to get forms and watermarks! | One button saves the HTML page as PDF! Goodbye PDF to extract charges! Use 90 lines of code to create the strongest PDF converter, Word, PPT, Excel, Markdown, HTML one-to-date conversion | Make a staple low-cost ticket prompt! | 60 lines of code made a voice wallpaper switch every day to see a little sister! |

Annual explosion case

  • 1). Lying! PDF to Word Use Python to easily get it!
  • 2) Learn Python is really fragrant! I made a website with 100 lines of code, helping people PS travel pictures, earn a chicken leg to eat
  • 3). The first broadcast over 100 million, hot all net, I analyzed the "Sister Taking Wind and Waves" and found these secrets
  • 4) 80 lines of code! Do a Dream in Python with Python
  • 5). You must master the 20 Python code, short and delicate, useless
  • 6). 30 python hambo skills
  • 7). I summarized 80 "rookie Python selection dry goods.pdf", all dry goods
  • 8). Goodbye Python! I want to learn Go! 2500 word depth analysis!
  • 9). Find a dog welfare! This Python reptile artifact is too cool, automatically download the girl picture