What's everyone take down here welcome back to another video today I am super excited because it has been exactly One year since I started to better my life and cut out a lot of things So the main thing that I've cut out this past year was soft drinks in general Anything like that pepsi's coke anything in between I just cut all of that out because At the time I think I've explained this last year. We never made the video where I said that I've cut all of this stuff out Back whenever I got my first job back in the 11th grade in the summers when I started so in the summer I was full time and I would take one can of pepsi or coke or whatever I had at home I would take one can in the morning. So I'd go in at nine o'clock my lunch was at two I would finish it off before my lunch I'd have a second can on my lunch time Uh, and then I come back for two hours So from three to five I'd have a third can and then usually that night's whenever I'm just at home relaxing I'd have another can so over that summer whenever I first got my job back in the 11th grade I'd have four cans of pepsi a day that was a lot and I'm kind of ashamed that it was that high and I just for some reason last year Um, I wanted to cut a lot of that out of my life I don't know exactly. I can't remember exactly what happened back then what happened a year ago that made me want to do this maybe it's just me Maybe it was just me wanting to feel better Maybe it was just me wanting to Maybe lose weight. I don't know exactly why I decided this But I did and I didn't think I could honestly do it because I like I said at the time Close to whenever I a year ago whenever I cut them out completely I basically cut cold turkey I wasn't advised to or anything I just did it and at the time I was still drinking one can a day at least so I was drinking it quite often So I didn't think I'd be able to do it so a couple weeks into it haven't had Anything to drink and I felt I was getting I was feeling a lot better basically And I just for some reason loved that feeling of having a little bit more energy As you guys know because I've mentioned recently that I have fibro and it helped that out a little bit more now with fibro I still get tired at times, but it's not Like it was whenever I was drinking sodas a couple weeks into cutting it out a year ago I ended up pouring Pepsi for my parents brought it into them And then I poured a sip for myself to try it and I knew myself that I would likely be going back into it like kind of like a relapse But I tried a sip of it and this was all a year ago. This was About two weeks after I cut it out cold turkey I tried it again and I honestly couldn't stand the taste It was disgusting to me. I instantly spit it out and I never tried it again since Haven't had a sip haven't even wanted a sip which is weird for me because I was wanting Like I said a can a day. That's what I was used to and cutting it out cold turkey Didn't think I could do it, but if I can do it Anybody in my opinion can do it as long as you have the right mindset and you want to do it If you don't want to do it You're obviously not going to and you're gonna fail But if it's something that you feel like you want to do You can do it I cut it out cold turkey didn't think I could and right now is one year since I cut it out this past year I made a video before about One month after cutting it out and I remember uploading that one and mentioning that I just felt better felt more energy I felt healthier in a way It's way better now that it's one year since I've cut it out No soft drinks or anything in one year now what I drink mostly now is Regular juices like apple juice orange juice stuff like that occasionally A lot of water I drink a lot of water now, which is something I wasn't used to But it's more hydrating. It's more refreshing than having a Pepsi. I'm drinking a water I'm drinking about the eight glasses that you're supposed to a day So I would say I'm easily doing that and I'm able to do that I've also been drinking Ice tea, which in the u.s. You guys call it sweet tea if there's any Americans watching this That's a little bit different than what you guys classify as sweet tea. I don't know how to describe it But I've been drinking that Um, because that even has way less sugar than soft drinks way less sugar way less calories I've even been drinking Gatorade more. I used to only drink Gatorade when I was sick Now I drink Gatorade almost regularly and water more than anything but I'm at least once maybe twice a week drinking Gatorade because that is way less Sugar and calories than in Pepsi and soda and coca-cola or anything carbonated like that. So to me it was almost like I didn't like the Dark sodas mainly because those felt heavy on me whenever I was drinking sodas. I just felt heavier Whenever I cut them out. I just felt better. I felt like I had more energy I felt like I was able to do more. I was able to sleep more now fiber has affected my sleep a little bit more now But if I was still drinking Pepsi's it'd be way worse than it is right now So all in all it has helped me out more than I thought it would for just cutting something like that out Um, I'm going to be doing more back then. I was drinking smoothies quite a bit now I haven't been but I've been replacing it with other stuff. I've been eating a lot healthier than I once was So I'm extremely happy with that.  Maybe like a runny nose stuff like that But no, I haven't had a cold. I haven't had a flu. I haven't had anything like that.  I don't know if has anything to do with cutting out sodas or anything like that but Um, I feel amazing. So occasionally when I'm sick, I do have gator aches That's usually what I always drink ginger ale because I need that carbonation whenever I'm sick But ginger ale is healthier than having Pepsi or anything else and I only drink it when I'm sick So since I haven't been sick this past year, I haven't had any or needed to have any But that's the only soft drink I will have moving forward in the future Only when I'm sick or maybe Thanksgiving Easter or Christmas because we usually have that mixed with grape drink Which is amazing. So that's the only soft drink I drink Now so I'm extremely happy with my progress now As you guys know because I've mentioned before I am hoping to get into the border really soon I have to pass a fitness test medical Pressure tests a whole bunch of stuff. So I'm gonna have to get in more shape than I am now at least The minimal is I'm gonna have to start running more. I have to get my endurance up to be able to pass one of these tests. So By me cutting out soda a year ago It's very Accomplishable me getting through the border stuff and passing the fitness tests and that because I just feel a lot better I have a lot more energy and I'm able to do more than I once was so For me cutting out soft drinks a year ago was well worth it I would recommend it to anybody not necessarily if you want to lose weight because I haven't seen Much weight loss since because I've still been eating the same Scratch that I haven't been eating the same. I've been eating healthier, but same amounts pretty much I used to eat a bag of chips. I used to be able to eat a bag of chips a night now. I have maybe A bowl of chips once a week and usually lately it's been with a bowl of salsa. So My mom makes homemade salsa, which is healthier than the store-bought salsa. So that's what I've been doing But I eat a lot better now But for me, it feels like I'd be able to nail this out So I haven't seen any weight loss this past year, but I felt a lot better So if you're somebody that wants to feel a lot better if you do drink sodas and drink them quite a bit It might be something that you might want to consider Cutting out and it might help you. It's going to be hard at first. Like I said, I two weeks into it I tried or not tried I took a sip of Pepsi, but I just didn't like the taste I hated it. I thought it was disgusting spit it out right away. I never tried it again since so If you cut it out for a little while, maybe that'll have the same effect for you Which might make it easier for you moving forward, but Anyways, I'm super excited. That's been one year since I cut out soft drinks I feel a lot better and I'm going to continue doing this moving forward. I'm not going to be having any soft drinks I don't even plan on. I don't even want it anymore. I just drink water Iced tea occasionally and Gatorade. That's the main thing I drink Juice in that too, but water is what I like the most now, which is surprising But I just want to I just wanted to make this video because it has today been exactly one year since I cut it out I kind of wanted to give you guys an update. So I am going to leave this video here I hope you guys did enjoy. I hope this has helped you guys understand minimal minimally What's You can expect one year after cutting it out Not much weight loss unless you cut out Your eating habits as well, but you do feel a lot healthier. So I'm going to leave this video here I'll see you guys in the next video. Please take care. Peace


I'm really pleased to be able to host our colleague from Beijing, Michael Pettis, who's a professor of finance at Peking University School of Law School of Management, who's had a long career of teaching at Peking University, Shilong University, and also before I was a trader and banker and risk analyst in Wall Street. I think has given him a perspective that's just different from what we often go out and understand. Michael, when we first got to know each other, was extraordinarily outstanding in the sense of being standing out to the crowd and the views on where China's economy was going. And the crowd has been moving closer to Michael and I've lost him in the last few years. And I think given that we have a lot of party colors coming on, this is going to be the people I go out to talk about for the next couple of years. This is really a good time to take a look at the performance of the economy. And what opportunities and risks might be posed by choices that people are going to find colors in the future, or that the colors are the months they follow. Michael, welcome back. Please, but just gotten off the train to New York tomorrow. Thank you for your patience. Thanks very much. What I wanted to do is, rather than make predictions, is sort of trying to set out as logically as I can to figure out the four different states of affairs. The four different ways in which China could be. And I think from there, then it becomes pretty straightforward to try to figure out what the policy options are. Because you know where you have to end up and how I think about it. Then the question for policy is, what are the various paths you can take to get where you're going to end up? Now, a lot of economists would be very uncomfortable with this approach. Because our basic assumptions, we assume that there is greater flexibility and closer to a kind of deliberating system. And so therefore it's really hard to set out the different options. Because they're quite close to each other and there's a lot of self reinforcement and sensitivity to initial conditions and all that stuff that's so fashionable. But I think the great American tradition of economics is what used to be called institutional economics. Which was made out of fashion in the 1960s and 70s. And if anything, I would consider myself a kind of institutional economist in the sense that I think when you've got very, very powerful and very rigid institutions within a system that prevent automated adjusted mechanisms, you get really deep imbalances. And the thing about imbalances is that they always reverse. So the question really is figuring out the different ways in which they reverse. I would say there are two really important imbalances in China. Because we've been very controversial about this. One is the income distribution. Which is what we talk about when we talk about the imbalances of China's economy. The household share of GDP in China as a result of policies that generated huge amount of growth in the last few decades has become the lowest. If you exclude one or two Arab oil sheet loans, which are complicated for different reasons, has become perhaps the lowest we've ever seen in history. And this has really important implications for China's growth. And by the way, it explains why China has the highest savings rate in the world. It's not because China's households say a lot of money. It's because they consume a very low share of GDP which is because they retain a very low share of GDP. So that's going to rebalance one way or the other. By which I mean the household income share of GDP is going to become bigger. There's no way around that. But it could be sold away, happening in the U.S. in the early 1930s where we saw a U.S. GDP being backed by 30% by 30%. And household income being backed by only half of that. So it became a bigger share. And you can see in the Japanese way where in 20 or 30 years of GDP growing at half of the 70% of the household income growing at roughly 1.5%. It always rebalances. And the question is how do you go about doing that? The second really big imbalance in China is one of leverage. I believe, and I think by now there's not too many people who disagree, but I believe that China has an enormous debt burden which is not the same thing as saying it has a lot of debt. If you borrow $100 and invest it in a project that's worth 110, your debt goes up, but your debt burden goes down. The problem in China is that it has a huge debt burden because it is invested in projects that are worth less than the cost of the project so that the debt has grown faster than the debt servicing capacity. If you look at debt-to-GDP ratios, which in my class is a way to get an F if you compare countries on debt-to-GDP, it's a useless comparison, literally useless, not bad, useless. But if you look at it on that basis, China has one of the highest debt levels we've ever seen for a developing country and that's assuming that we know where the hidden debt is, which we probably don't. And it's the fastest growing debt we've seen, maybe ever. So I think it's a safe bet to say one way or the other the country will deleverage, but there are different ways you can deleverage. You can deleverage by growing your way out of the debt, which by the way, no country in history has ever done. It's always the plan, but no one's ever able to pull it off once you have heavy debt loads. You can default and restructure the debt at a haircut or you can inflate it away. There's lots of different ways. But the magic trick to deleveraging is pretty straightforward. There's no magic to it. It's just a question of assigning the cost of the debt to somebody, to some sector of the economy. So when you default and restructure with a headache, you've assigned the cost of the debt to your credit, with a headache, with a haircut. You've assigned the cost of the debt with a headache to your creditors. If you inflate it away, you've assigned the cost of the debt to savers, either the wealthy or ordinary households.  But then you assign the cost of the debt to the workers. So the way I look at it very simply is this is a question about how do you assign the cost of the debt, the whole issue of deleverage. So with that start, what I would argue is that there are four ways you can think about the Chinese economy. One way is sort of the blissful way, which I don't think anybody explicitly believes that anymore. But I think a lot of people implicitly believe it. It's an implicit assumption in their models and that is that basically we don't have a problem, right? That China is growing at six and a half percent. Isn't that great? Most countries would kill for that. And so the economy is doing fine. Okay, it has a few problems, but basically we're fine. I want to address this issue of six and a half percent growth because China is not growing at six and a half percent, at least not in a meaningful way. And I'm not saying that it's because they're lying on the data. There's a little bit of that going on, but not as much as people think, I don't think. The reason I say that is because of what GDP means and I won't get into a big discussion about it because in my latest blog entry for those who are interested in a boring accounting topic, my latest blog entry on the Carnegie site, I try to address that. But the basic argument that I would make there is that when you're calculating GDP, GDP is just a measure of economic activity and it's a measure of economic activity defined in certain ways. And what we need for GDP to be useful is a mechanism that causes this measure of economic activity somehow to conform with whatever it is that we want it to conform with. Much of GDP was developed during World War II. So at the time, among other things, we needed GDP to tell Washington the amount of resources available for the war. So GDP includes a lot of things that we might not normally think of as part of well-being, but that were part of the definition of GDP because it was developed during wartime.  And to explain what I mean by that very simply, let's assume that there are two Chinas that are identical in every single way, except in accounting treatment. So the same people doing the same thing, generating the same economic activity. Now, if in both of those Chinas, you take 100 Kuai and invest it in a project that's worth 20 Kuai. In both cases, you immediately get a boost to GDP through the investment times some multiplier, whatever it happens to be. Now, what happens next is very important because in some cases, well, I shouldn't say in some cases, what you're supposed to do once you recognize that that investment is not worth 100 Kuai, it's worth 20 Kuai, is that you write it down. And as you write it down, that shows up as an expense, which shows up as a reduction in profitability, which shows up as a reduction in the value-added component of GDP, right? So you write up your GDP and then you write it down to reflect the fact that the investment that you made had very little value. It didn't have the value that you put into it. Now, we said there are two Chinas that are identical. One China does this. It writes it down and the other China doesn't. Those two Chinas are going to have two different GDPs. So right off the bat, that should worry us because our initial assumption is that these are identical Chinas. They're doing exactly the same thing. So if GDP is meaningful or if it's a reasonable proxy, they should have the same GDP, but they don't. A quick aside, some people say that's incorrect because, and it's always incorrect because they say that normally the normal wear and tear on assets doesn't show up in the GDP data. And for those who are concerned, this is not normal wear and tear. This is a charge to the value of the assets. This is an actual expense and it has to show up in the same way any other expenses do. So if you don't do the expense, you're going to show up with a higher GDP. The reason I bring that up is because if you believe that there is a substantial amount of misallocated investment, then you must believe that either it's being written down, in which case you would have to show where it's being written down and find it being written down, or GDP must be overstated relative to an economy that would write it down. So from that point of view, when people say, but everything's fine in China, it's growing at 6.5%, that's good. I would argue we have to be really, really careful there because depending on your assumption, it might not be, it might be growing at much less than that. I happen to think it's probably growing less than half that rate. But if you believe misallocated investment is not being written down, there is some gap between this GDP as a proxy for value creation with its mark-to-market mechanism and GDP as not that. And that the same China can portray two different GDP numbers. So at the very least, you should be a little bit worried about what GDP actually means. But in my first scenario, where everything is fine, of course that's not happening. The 6.5%, 7% growth, that's the real growth, the way we would measure it in other economies and bad investments are correctly being marked-to-market. So the assumption there then is that we don't have a systematic problem of investment misallocation. Things are fine. And also that we don't have a debt problem. If you disagree with that scenario, and I think most of us probably do, then you have three other scenarios that are possible. One scenario I'll call the reform scenario, and it's always the scenario historically whenever countries have debt problems. When you have a debt problem, you do two things. You announce that it's a liquidity problem, not a solvency problem. You just need time. And then you announce that you should never let a good crisis go to waste. We're going to implement the necessary reforms that will allow us to grow our way out of the debt. This is sort of the... For a long time, this was the model proposed in China. I think still a lot of people believe it. I have a bunch of problems with that. The problem number one is historical problem. And that is, as I've said, whenever a country starts running into debt concerns, this is always what they do. And I've yet to find a case of a country that was able to implement reforms sufficiently to grow its way out of the debt. I've never seen a case. I had this discussion last year with Martin Wolf, the editor of The Financial Times. And after I got home a week later, he sent me an email and said, you're wrong, I found an exception. It was England after the Napoleonic Wars. Now, for reasons I won't get into, I don't think that's an exception, but it's interesting to me that this guy who knows a lot about financial history had to go back 200 years to find an exception. It is hard to grow your way out of debt. And I would argue that there's a bunch of reasons, but perhaps the most important reason, and that's the topic of my next book, if I ever get around to it, is that in finance theory, we know something that we don't seem to know in economics, and that is that debt itself can constrain growth for a whole bunch of reasons. We call these financial distress costs. But I would argue that that's the problem. When you have excessive amounts of debt, the debt itself becomes a constraint on growth. And whenever you think of a case of, I said this in Russia last year, and I forget his name, an economist at Beida, so I don't know, but China did that. We grew our way out of our debt crisis in the late 90s. No, you didn't. The way that debt crisis was resolved is that basically the cost of the debt through negative real interest rates, that was severely negative, if you have negative real interest rates, you are basically forgiving debt at the expense of the lender, which is the household sector in the form of bank deposits. And the evidence of that should be a significant contraction in the household share of GDP. And the household share of GDP in the last decade collapsed. Household consumption was roughly 46% of GDP in the year 2000, which is a really low number, not unprecedented, but low. And 10 years later, it was reported to be 35%, which is a surreal number. All they did was, they delivered by assigning the cost of the debt to the household sector. So what I'm going to argue, historically, that's the only way we get out of debt problems. It's a question of paying down the debt or not paying it and assigning it to the creditor. And the key to that is always the assignation of the cost of the debt. Without that, nobody has grown their way out of a debt burden, and I don't think anyone can. But still, that's my theory. You could disagree with it. You could say it is possible for China to implement these supply-side reforms, in which case growth rates will pick up enough to outpace the growth in debt. And once that happens, we begin the process of deleveraging. Well, we've been trying this for five or six years, and it's getting worse, not better. So I would suggest that if it is possible, we haven't figured out the trick. It's quite hard to do. And I did a really quick calculation a few months ago in which if you believe that China's reported GDP growth represents real growth and value. Forget everything I said at the beginning of this presentation. That China really is growing at 6.5%. If you believe that, it seemed to me that the necessary reforms would have to... something like triple productivity. In other words, new investment would have to be three times as productive as old investment to catch up to the debt. That's a pretty tall order. For a while, we were told, we just have to reform the financial system. If you reform the financial system so it does a better job of allocating capital, then it'll happen. But again, whenever I hear these things, I always try to look back at the history and say, okay, let's see examples of that. And I can't find any example of a financial system which had the type of reforms implemented that were necessary. We're talking about really radical reforms. I would suggest the closest case might be Chile at the end of the 1970s, beginning of the 1980s, where we saw a truly radical reform of the financial system. But remember that every single bank in Chile was bankrupt, the economy was in contraction, they just had a military coup. It takes quite a lot in order to have the ability to implement that nature of reform, it seems. But anyway, again, I don't want to say that this is... that the model is incorrect. It's possibly correct. It may be possible that with the right set of supply side reforms, China will start to grow its way out of its debt burden. The caveats I would have is it's never happened. It might be that it's never happened because the debt itself becomes a constraint on growth. And we've been trying it for years and not only have we not pulled it off, but we're falling further behind. And if you try to do simple calculations of the amount of productivity improvement, it seems pretty dramatic. It seems pretty hard to do. So maybe this works, maybe it doesn't. The third scenario is the scenario that I personally think is the most likely. And that is that there is simply no way China can grow until it rebalances demand towards the consumption side because the investment growth, which continues to be the main or one of the main sources of growth, investment growth is a debt generator. There simply is no way to find enough productive investments without significant reforms in the legal system, financial system, and lots of other things to allow you to get back on a track of investment continuing at these very high levels and not leading to investment misallocation. If you believe that, then you've got to bring investment growth down. But if you bring investment growth down, since that's a major source of demand, you've got to bring another source of demand up. And what are those other sources? One source is good investment, which is really taking us back to the second scenario, which I think is very unlikely. One source is the trade surplus, but China is just way too big to be able to grow through the trade surplus. And then that only leaves us with consumption. That's the only other source of growth. And if you believe as I do, and I think it's hard to argue with the numbers, that the reason consumption is so low in China is because household income is so low during 30 years of China growing at 10%. There were simultaneously mechanisms that transferred wealth from the household sector to net borrowers, most important being the interest rate, so that the household share of GDP contracted to the lowest perhaps in history. Then the solution is quite easy. You've got to increase the household share. While the economy is slowing and while investment is going down, household income has to continue growing. Now, how do you do that? If economic growth drops 3% or 4%, how do you get household income to grow at 6% or 7%? Well, once you go through all of the smoke and mirrors, it's quite simple. It's simply reversing the transfers instead of transferring money from the household sector to a group that ultimately we can refer to as the so-called vested interests, the local governments and the local elites, you now have to reverse that. So you have to transfer money from local governments and local elites to the household sector. There's a million ways you can do it and the problem is so big that they're going to do them all. But you can privatize and then use the proceeds to increase spending on the household sector, education, health, or you can use it for payments, unemployment payments. There's a lot of different ways. You can eliminate the Hukou system, which immediately makes migrant workers richer. It's going to be hard to do that. But theoretically, it makes migrant workers richer, makes local governments poorer because now their expenses go up. There are lots of different ways you can do it, but ultimately they boil down to the same thing. You've got to transfer wealth from the household sector, I'm sorry, from local governments and the elite to the household sector. Now, the good news is that in China, unlike in most countries, the net position of the government is quite positive. There have been a bunch of studies the most recent one I saw was by Thomas Piketty. He was looking at inequality in China, which of course is a problem. But what he said was that on a net basis, local governments are long, roughly 40% of GDP. Now in most countries, like in the U.S., the net position of the government is zero or slightly negative. We have more debt than assets, but not in China, which shouldn't surprise because of all these wealth transfers over 30 years, local governments should have assets. Piketty argues I have no idea how accurate his numbers are, but they feel good, they seem like they shouldn't be wrong. He argues that they're long, that is they have more assets than liabilities by roughly 40%. Now, that's not so simple if it was a company, then the problem would be solved. You sue them, liquidate the assets, pay down the debt, everyone's happy. It's more complicated than simply liquidating the assets and paying off the debt. The local governments have two types of assets, SOEs and real estate, and it's incredibly unlikely that they're going to liquidate massive amounts of real estate because of the impact on the banking system. But still, at least in theory, there are good, solid reasons to think that it's possible to transfer assets from local governments and local elites to the household sector. The problem is when you look at the history of debt resolutions, as I said, it's always a question of assigning the cost of the debt to some sector or the other. What you find, no big surprise, is that the groups that are politically most vulnerable, for example, in the U.S., the household sector, ends up one way or another eating the cost of the debt cleanup. It's always easier to force the cost onto politically vulnerable sectors. The problem in China is that you can't really do that because if you force the cost onto the household sector, remember, rebalancing requires that we increase household wealth at the expense of governments, not the other way around. There are many ways you can do this. You can monetize the debt, you can use financial repression, which is what they used last time. There's lots of ways you can force it onto the household sector, but if you do, you can more than ever on an acceleration in investment growth and in debt in order to keep growth levels reasonable. So you can't really assign the cost of the household sector, or you shouldn't, because if you do, China's not going to grow for 30 years. So who else can you assign it to? You can assign it to small and medium enterprises. They're pretty vulnerable, but they're also the only really well-functioning part of the economy. They're actually very efficient, and you don't really want to cripple them, because, again, it's very hard to imagine that China will grow over the long-term if small and medium enterprises are forced to absorb the cost of all of this debt. So if you don't do households and you don't do private businesses who's left or foreigners, but they're too small, you can't really assign the cost of the debt to them, and so then you're left with basically governments, local government or the central government, and for political reasons, it should probably be the local government. So that third scenario that I'm talking about involves two types of transfers in order to increase the household share of GDP to keep consumption growing quickly so that you can bring investment down. You must transfer wealth from local governments and local elites to the household sector, and in order to deleverage, you must liquidate local government and local elite assets and use the proceeds one way or the other to pay down the debt. So you see the problem. The problem is that the solution economically, the best economic solution is the assignation of the costs of the adjustment to those groups that most benefited from 30 years of growth who have subsequently become very, very powerful. Now, we discovered I apologize for repeating. I think I say this every time I speak here, but we discovered in China, we discovered the vested interests in the late 2007, early 2008. Before that, I'd never heard of vested interests, and after that, they were all over the press. And remember that it was in March 2007, I think, when Premier Wen gave that famous before unbalanced speech and promised it would become the top priority of Beijing to rebalance the economy. Had we read our Albert Hirschman, we would have then said, this is going to create a problem. That's going to create political opposition to the process of adjustment, and it seems to have done so. This is why I say that third that third scenario is the one that I think is the most likely. That Beijing understands what the issues are, understands how politically difficult it is to implement the necessary reforms, which is why the first thing the President did in 2012 or even earlier was to begin this consolidation of power. Now, I don't like to talk too much about politics for obvious reasons, but I would argue that it's a necessary thing. The historical precedents are pretty clear about that. It is very hard to implement the types of reforms that Xi and the people around him need to implement in a decentralized system with very, very powerful opposition. And then finally, there's the fourth scenario which is that so far I'm right, the first scenario is wrong, the second scenario is wrong, but instead of the third scenario where you systematically go about forcing through the rebalancing and the deleveraging process, you don't. And in that case, it just seems to me pretty easy to predict what happens. Debt continues to grow. Now, there are constraints on the growth of debt, but people always say it's not a problem. We just get the PBOC, the People's Bank of China to monetize the growth in debt. Debt grows as much as you want as long as you have a credible central bank that's able to monetize it. Let's assume credibility is infinite. The problem there is that monetizing debt doesn't create debt. It simply transfers resources from those who are long monetary assets which is the household sector through savings deposits. So if you allow debt to continue growing, at some point you begin to counter and maybe we're there last year about a fifth when new debt was monetized. But at some point, you start putting downward pressure on the growth in household income. And remember, we've got to get it up, not down. So if you accept the fourth scenario, then this keeps on going until it stops. And when does it stop? We don't know. There's no formula that tells us when you run out of debt capacity. Lots of things. That's part of my next book. It's part of my first book too. Why do we have crises? The point that I would make there though is that one of the things that always kills me is when people say, you know, Pettis is wrong because we haven't had a crisis yet. And I would say, yeah, but what I said was we have a really big debt problem and we're not going to have a crisis. So the fact that we haven't had a crisis doesn't mean that it was wrong. The problem there is I think when you speak to most economists and you ask them what is the problem and no, a crisis is a brutally painful way but it's a way of resolving a debt problem. The problem of too much debt is the too much debt itself. And if you don't have a crisis, as we saw in Japan, which is always my favorite example of what we should look out for in China, in Japan we went from an economy that everyone knew would become the biggest economy in the world by the end of the last century, which was roughly 17% of global GDP, which today is 6% of global GDP. And I don't think we are astonished enough by that. I can't find any case except in war where a country lost such a dramatic share of global GDP. To me, that's the problem with too much debt. It's that it stops growth, right? So let me recap then and then we can open up to questions. The way I see it is that logically there's only a few ways you can think about China. You can think that things are fine and we don't really need dramatic reforms, that this is good growth. We just need to keep this going. You can think that the basic model is okay, but it's showing its age. We need reforms, call them supply-side reforms if you want. That'll cause productivity growth to pick up so that we can get this temporary glitch where debt's growing faster than debt capacity where we can get it behind us. And then the third model is or the third outlook is you can't do that either. We have a fundamental problem where we have to reverse as we have in every single case in history of this type of growth model where we have to reverse the model and bear the adjustment costs and the question really is what type of adjustment costs and the best scenario which is the one I think is most likely is an orderly adjustment but it means much slower growth. Like I said, we may already be there. And then the fourth model is that yes, all of that is right but we're not going to do the adjustment. In which case we know what happens. If the adjustment always comes, the question is, is the adjustment directed by policy or is it not? And basically the difference between the last two is in one case it's directed by policy towards in a direction that is economically optimal although politically difficult in another case it's not. So let me stop there and open up to questions or comments. Thank you very much, Michael. First, let me make a couple points. If you're here you know about the Carnegie Endowment website. If you want to read more of Michael's thoughts, he has China Financial Markets as a monthly blog on our Carnegie website. Just go to ceip.org go to experts, Pettis will give you a menu of his writings. Secondly, we are going to have a session here at Carnegie on October 6th to talk about the politics. What's going on behind the scenes. If you have questions on that subject come back on the 6th. You will have received an invitation if you're here to hear from the China Leadership Monitor team a number of really outstanding authors who I think represent the best of contemporary China analysis on what we can expect from the party Congress. Now let me ask a couple of first questions, Michael. One, as I looked around the room I think maybe you need to explain what is the means by which you monetize debt. One of the choices. Okay. Monetizing debt simply means money. There are different ways you can monetize debt. The classic way and the way people always warn you, they say the reason you cannot simply allow debt to grow. So for example a company wants to make a loan. It doesn't have the deposit with which to make the loan so it simply goes to the central bank which creates the money or the accounts necessary for it to be able to extend the loan. That's monetizing the debt. Now that represents a creation of wealth on the part of the borrower. Today I had nothing tomorrow because something that the central bank did I am now able to borrow real resources. I'm able to increase my hold on real resources. I borrow the money and I bought some copper. So I'm now richer by that amount of copper. Now logically there's only two ways I could have gotten richer. One way is that the process of monetizing the loan somehow also created an increase in wealth which is not as crazy as it seems. And then the other is that it was transferred. If I am richer either that wealth was created or it was transferred from somebody else.  The fact is both happens. It really depends on the underlying circumstances of the economy. If you had a huge amount of unused capacity, a huge amount of unemployment, etc. Then monetizing it is a form of Keynesian pump priming if you like. You basically create purchasing power and that purchasing power is immediately translated into additional economic activity. Unemployed workers are working. The factory that was closed is turned on. It starts producing stuff. At the extreme, which probably impossible to happen in real life but at least theoretically, at the extreme you could create the full amount of resources that you're using. In case the economy is richer but we have to figure out the specific circumstances under which that happens. It doesn't happen automatically. It happens under certain circumstances and it may not be able to happen 100% but it can happen substantially. In which case we should be doing it because it means that you're utilizing unutilized resources including labor to make the economy richer. But if that doesn't happen then there is no way you can get richer unless somebody else gets poorer. There has to have been a transfer and the way the transfer typically occurs and it's the way we're always watching for so when it doesn't occur this way we say ah it didn't happen and that is through inflation. So the theory says you create the money, the money creates inflation and the inflation erodes the value of the savings of people who are long monetary assets which in the US would be the rich in China would be ordinary households who their savings deposit. The rich are often able to protect themselves by the way but in theory if you are unprotected long monetary assets, if you have dollars in your pocket or if you have a dollar bond that doesn't adjust with inflation then inflation erodes the value of your wealth and so it was simply a transfer but it doesn't have to be through inflation and in fact it often isn't and in China it wasn't. You can do it through negative interest rates which is how they did it in China and that is in the last decade you had the Chinese economy growing nominally at an extraordinary rate 16 to 20% nominally not real Jesus I'm very clumsy sorry is it still working? Yeah and you had the GDP deflator at 8 to 10% which may be the best measure we're always not comfortable with it but it may be the best measure of inflation and then you had the lending rate in the first half of the decade I think was 6% and the second half was 7% in that environment the lending rate should probably be we can argue but between 12% and 16% it was between 6% and 7% and you had the deposit rate I think 2.5% in the first half of the decade and 3.5% in the second so you see how it works right you put 100 Qui in the bank a year later you have 103 Qui but it takes 110 Qui to buy whatever it was that you could have bought with 100 so you've lost money and that money that you've lost has simply been transferred to the borrower so that's what monetizing means it means one or the other depending on the circumstances thank you I think that helps a lot of people second question in July Xi Jinping gave an important speech went to a vast array of assembled officials and the history suggested that a speech to that group preceding a party congress indicates what we're likely to see in the government work report will be made at the party congress this one did talk a lot about debt the speech was focused on resolving the debt not so much on fiscal reform do you see any relationship between managing this debt problem and fiscal reform to me it's really interesting because you know there's there are people who know what's going on there's a small group I'm not one of them none of us are one of them I don't think there are people who have a pretty good idea or a better idea of what's going on I'm not one of them I think he does but from my point of view it seems to me and I'm just guessing a speculation it seems to me we've seen a significant split within the government about this whole issue of debt and I would argue this goes back at least to the economic conference in December of 2015 when supply side what was the big thing my interpretation of what happened and it seems to have been confirmed by the famous those two famous people daily articles that came out in March or April of that year it seems that what's happened is my interpretation I want to stress this is that the people around she were extremely frustrated and basically said you guys meaning I don't know who people around Lee I'm not sure you guys have been saying that debt is manageable year after year after year and it's getting worse and worse and worse at an accelerating pace we have a problem with the debt and I think that may represent the split between what I call the second of those outlooks and the third if you believe that we're in that second thing then debt is manageable we have a discussion of implementing the right reforms that allow us to grow our way out of the debt if you're in that third group and I think again I really want to stress it's very speculative but I think the people around she and perhaps Wang Qishan may be in the third group you've reached the point where you said no that's it we can't grow our way out of debt we've got to do something about the debt so maybe that's what's coming out we hear more and more about it and it's really becoming an incredibly fascinating episode for people who watch Modern China I'm prepared now to open for questions from the floor when we call on you please wait for the microphone so we can get this recorded properly secondly identify yourself and then ask a real question in the second row here it's like a Princeton tie I'm David Epstein from the Office of Net Assessment at the Pentagon I wondered if you could give a historical description of your GDP adjustment in other words has this problem of unrecognized bad debt been infecting the GDP statistics since 1979 or is it more recent how would you correct the overall record I think one thing that we can all agree is in the 1980s China was significantly under invested no bridges, no airports no factories etc etc in that case the best development model I think is what I call the Gershengkron model which is exactly what China thought which a number of countries have done every investment growth miracle has done this first of all you have to raise the savings rate because it's savings that get invested and how do you raise because you don't want to depend on foreign savings it's too risky and developing countries tend to have low savings so how do you raise the savings rate between the growth and household income that's what they all do there are direct taxes or indirect taxes so as you constrain the household income share you constrain consumption you force up the savings rate which they did very successfully and then secondly Gershengkron pointed out that in developing countries there is maybe because of time horizons but the private sector doesn't do a good job of investing in all of the productive investments particularly infrastructure so that needs to be centralized and the result as we saw was the most rapid increase in investment perhaps in history and that's exactly what the doctor ordered because China was significantly under invested so if you can increase investment intelligent investment but you know the joke back then was you could throw money in the air and it became productive because they needed everything so they grew very rapidly and very healthily but at some point you reach the point at which it is not so obvious where to invest now one model says that point is the so-called capital frontier that's the United States you've got to catch up to the US per capita investment and then you've got to come up with a different system I think that's wrong the other model says that every country has its own optimal level based on its own mix of institutions the difference between a rich country and a poor country is not that rich countries have more bridges it's that rich countries have a legal system, a financial system an educational system whatever you like all of these institutions which is why economists we don't like to talk about it because we can't put it in a correlation analysis we need this mix of institutions that allow our workers to exploit resources productively and if we don't have them the level at which they're able to product them is much lower now where is that level once we reach that level broadly speaking really abstract terms that's when you start to get the misallocation of investments and I would say a few years ago you know no we're nowhere near that level I think everyone agrees that we passed that point but when I think it could have been as early as the late 90s early part of the last decade it certainly seems to have occurred in the last few years so how much of an overstatement of GDP growth is there I don't know but it could be quite a lot and the reason I say that is because I already mentioned Japan Japan was 17% of the world and then went down to 6% of the world I don't believe that I don't think it was ever 17% of the world I think it had a lot of bridges to know where that boosted GDP it made GDP look much higher because to me to go from 17 to 6 is truly extraordinary so there could have been an awful lot of overstated GDP in Japan but there's another similar case every investment every one of these investment miracles we end up overstating because the adjustment is much worse than we thought but remember that in the 1950s and 60s the Soviet Union too was growing so quickly it was going to become the biggest economy in the world very very soon Paul Samuelson our first Nobel Prize winner in economics very kindly gave us the date in 1961 he said in 1984 that the Union will overtake the U.S. to become the world's largest economy didn't happen I suspect that Soviet GDP was also significantly overstated and I think now there's sort of a consensus that that happened so that's not really an answer but my warning is that from the historical precedence it could be a big number we don't really know so there could be a significant figure in the third row here please wait please wait for the microphone I read somewhere that the percentage of China's income come from trade up to 45% that's statistic reliable and if that's the case we buy in on trade is so heavy how can you well I think that number may be if you add total exports and total imports as a share of GDP I know that in China the number is quite high it could be that number being well integrated into the global trading system is usually a positive not a negative so I wouldn't see that as a bad thing for China it does mean of course to the extent that you depend on the external sector it does mean it's vulnerable to events in the external sector the global crisis in 2008-2009 hurt China quite a lot China's current account surplus contracted from 10% to 3% and for those who are technically minded that means the excess of savings over investment contracted and there's only two ways that can happen either savings goes down and the easiest way to do that is through massive unemployment or investment goes up and of course being chose to increase investment significantly to prevent a rise in unemployment which may or may not have been the right thing but that seems to be what happened that's the danger of an excessive vulnerability to trade but generally speaking over the long run I think that's a good thing we now have another problem which is the current account surplus the way I think about the surplus is in debt terms demand consists of investment which it's debt consumption which we would like to see rise without debt so the increased consumption share we've seen recently may have been caused by the explosion in household debt which is the wrong way to rebalance and then by the by the current account of the trade surplus really and the way I think about it very rough calculation is that every one point forced contraction in China's current account surplus or trade surplus requires an increase an additional one-third debt that is one-third of the total amount of debt it takes to hit the GDP growth target right now the amount by which debt is increasing in China is roughly 45 percentage points of GDP maybe a little bit more depending on stuff that's not counted so as you can see it's a lot of debt so theoretically and this is a really rough theoretically if you were to contract the trade surplus by 3 percentage points it would require twice as much debt to hit the GDP growth target that current account surplus is a really important debt management mechanism the way I think about it so they're quite sensitive to that which is why I think there's a lot of concern about a lot of the stuff coming out of Washington there in the front row please hi the name is Judd Herriott going back to your scenario where the debt is assigned to the public sector assets are liquidated and transferred to the household sector if as you say the assets in the public sector are severely overvalued then doesn't this build in a kind of a deep constraint into this scenario yes I think there are a lot of assets there there's certainly overvaluation I think we have to make a distinction sorry I dropped this there are two ways SOEs can have too much debt or SOEs can be in trouble one is that they're just producing stuff that nobody wants right we don't really need a lot more ships a lot more steel etc those probably have to be closed down so you know they still have value they're still value there but you know those are the ones that we really need to worry about but I don't think there's a majority of assets local governments own lots of assets not just huge SOEs lots of other types of assets lots of other smaller companies and even among the SOEs there is a difference between an insolvent SOE that has good operations but is insolvent because it has too much debt and there we really understand that quite well in finance theory there if you eliminate the debt the value of the company the net value goes up in other words the enterprise if you get rid of $50 worth of debt you don't improve the enterprise value of the company by $50 you can improve it by $80 something there's some number there reducing debt actually increases net value because the debt itself is a constraint on growth and that's something we have lots of evidence for lots of theory for that's pretty well understood so I would say there are three types of companies owned by local governments there are good small companies that are fine that are working there are bankrupt SOEs that are in trouble because of the structure of their balance sheets and once you clean them up they're fine and then there are and I think there's probably less of this than we think then there are companies that should just be closed down and gotten rid of so the question is really how much of the first two do we have yes don't forget that for 30 or 40 years while the Chinese pie was growing at 10 or 11% and in the last few years it probably wasn't really growing at 10 or 11% in value terms but it was growing quite a lot the household sector was growing at 6 or 7% right so while their share was contracting the other share which a lot of it is local elites and local governments expanding and there's definitely value there it's overvalued but this is going on for 30 to 40 years so there's real value there there's a lot of real wealth in China that wasn't there 20 or 30 years ago on the front row again please Joe Pinder so you're discussing a really unique economy it's very large it also doesn't have what most classic economies that are trying to work through this have which is unfettered foreign investment ownership as a legal system allows the leakage of the property can any of this be changed if the investment caps in the legal system yeah one thing is I don't think it's that unique I think what's happened in China is an extreme version of something we've seen quite a lot so there's actually quite a few things we can say about it now this issue about intellectual property rights I probably shouldn't say this but it's very monastic there because the truth is it's hard to find a single advanced economy that didn't steal intellectual property rights it's an old story what's interesting to me is how that changes and why that changes and in the U.S. it's sort of easier to look at it on the cultural side because it's sort of more clear but what I look there is you know when Dickens came to the U.S. in the 1830s they had to get lots of adulation but it was also to complain bitterly about the fact that he was selling millions of copies in the U.S. and not getting a penny in the 1840s they started significantly to reform the copyright rules in part perhaps because of Dickens and to me maybe it's a coincidence maybe not but when you think of most of the great American writers of the 19th century before then there were mostly really rich people who could sit at home and write many of them we really saw the explosion in American literature after the imposition of copyright rules and something similar seems to happen in music because it was in the 1890s that you had significant implementation of copyright rules on sheet music which is how you made money back then and you know if you ask most Americans to name a famous American musician or composer in the 19th century the only one we can come up with is Stephen Foster and in the 20th century what the U.S. has got is the center of great music is there a connection maybe there is I suspect there is and I think in China there is this recognition that at some point you don't implement intellectual property rights to help the West because no one ever does that you implement them because it starts to make sense domestically and I think maybe we're moving in that direction in China what are the ownership caps you say you know looking back historically it's hard for me to find any clear reason to say that foreign ownership of assets is unambiguously good or unambiguously bad for development we've seen both cases the key issue for me could be savings related because in the 19th century rapidly developing countries most importantly the United States are very heavily on foreign savings and in the 20th century we don't like that and why don't we like that it's because the dependence on foreign savings seems to increase the probability of crises and the crises unravel all of the growth during the good period so what's the difference and I'm speculating now but it seems to me that in the 19th century most foreign capital inflows came in the form of equity investments and I read a lot about this in my 2001 book these are not caused by insolvency they're caused by the structure of the balance sheet and equity investments are very stabilizing because when you're doing badly you pay less, when you're doing well you pay more debt's the opposite when you're doing badly you pay more when you're doing well you pay less so maybe it's possible that the reason we don't like we don't like investment to be funded by foreign investment is because it comes in the form of debt it's moved towards the system because in the 19th century most British investment was in real estate the ultimate equity investment if it came in more of an equity form at least in a more stable form then maybe it wouldn't be such a problem but that's really how I think about foreign ownership nothing more sophisticated than that the United States principal foreign investors at the turn of the 19th century were in Holland and then UK and they got involved in the war in 1914 and they had to sell those assets they made a lot of Americans rich because they had to do the fire sale turns maybe the biggest transfer of wealth in history an IPR I was a back bencher in a room in Singapore in the early 1980s when George Shultz as secretary of state went to see Lee Kwan Yu the prime minister of Singapore they were personally quite friendly for a long time and he said to Lee you've been stealing stealing American product for your factories and things here well of course we do, we have to keep our boys in the party employed and Tommy Cole then the ambassador to Washington stood up and said Mr. Prime Minister we're now producing more to protect than we are getting value for what we steal and it's time to change that and they changed it and I think that's a microcosm of what happens you realize you have enough to protect you move on but you had another question here Stephen Foster, Aaron Copeland, Samuel Barber Aaron Copeland is more than 20 years old 20th century well Aaron was also in the 20th I want you to comment a little bit about the labor market in this country for example there are millions of jobs going begging because the education system is not keeping up with the demand whether it's electricians or whether it's nurses whether it's engineers I recall in China some years ago I lived in Asia 7 million people graduated from university and the minister of education was fired I think that was the case and what I recall was the reason why he was let go was because the people who graduated were not marketable so is the Chinese economy education system keeping up with the demand of moving maybe from hands from a hand type of economy to our minds to more thinking one or do we have a huge unemployment problem by the government it's such a complicated question it's very very hard to answer it with much confidence when I moved to China in 2002 they were graduating roughly a million and today yeah they're graduating a little over 7 million there's an enormous expansion in the educational system but not surprisingly there's enormous complaints about the quality of the education so in China you have this tiering of schools you've got you know like an Ivy League of 10 schools roughly and then there's I think 42 nationally important schools and then the quality starts to fall off very rapidly after that and so the competition to get into one of the national schools were particularly the competition getting into Peking University or Tsinghua it's just insane those schools I think are doing you know I'm prejudiced we're doing a great job I think they're doing a reasonably good job but I suspect that as you go to the bottom two-thirds of that 7 million there can be real questions about the quality of the education I'm a bit of a cynic there as long as my kids are doing well you know and his are doing well we've got some really distinguished people here in the audience and among them is Nick Laugherty from the Peterson Institute a true knowledgeable Chinese economist please Michael my question is whether or not there's too pessimistic about the challenge of the financial sector and the build up of debt currently non-financial sector debt that is corporations plus households there are different numbers floating around but you know let's call it 260-270 now there are plenty of economies that have grown for long periods of time with debt at that level so this level is not unusual I agree with you what's unusual is the pace at which you're doing 260 so the one way of asking my question is you keep talking about paying down the debt you don't have to pay down the debt all you have to do is get it to stabilize and you might do much better than you expect and if you think the goal is to stabilize that relative to GDP the magnitude of the challenge is more manageable than if you keep talking about paying down the debt eliminating the debt in many cases of countries with that level of debt that have grown well there's Japan which is not growing well Japan is the model I think we should be thinking about for China you can stabilize it at very very high levels without growth then there are a couple of other countries that are very rich countries advanced nations and one of the things that I always point out is that whenever we look at Chinese debt levels we say oh compared to the US that's insane you can't compare China to the US and Japan all you have to do is get a graph any period in time or a graph of crises and just graph debt to GDP versus debt per capita and you'll see it's a positive sloping line it's always a positive sloping line and what that suggests to me is that more advanced nations perhaps because they have more sophisticated financial systems are able to function at higher levels of debt so when you look at China on that graph you see it's a big outlier if you compare it to the US which is the wrong comparison maybe it doesn't seem like a lot of debt but aside from that it seems to me we have advanced nations with equivalent levels of debt that aren't growing and then we've got everybody else basically now remember what I said the debt to GDP is the wrong metric again I hope to be able to explain this in my book but when you have too much debt in finance theory and I would argue in macroeconomics too when you have too much debt to be technical it is when there is uncertainty about the future allocation of debt servicing costs because it's the uncertainty that unleashes the financial distress effects I'm sorry if I'm putting you all to sleep but the key point that I want to make there is that too much debt is not 260% of GDP debt is when there is significant uncertainty about how those costs are going to be allocated in the US which is the one reasonably growing but advanced nation that is able to function at that debt level there really isn't much uncertainty about the allocation of future debt servicing costs the US doesn't have a debt problem and the people who say they do look at the debt to GDP box which is not the place to find out whether you have a debt problem or not in finance theory we know that different types of companies have different levels of debt different optimal levels of debt depending on the underlying volatility of the business depending on the structure of the balance sheet depending on lots of stuff but I would argue that you cannot find a relevant comparison for China of a country with this level of debt that doesn't have a debt problem and that isn't facing a significant slowdown and growth and I don't know I mean if you know of other examples look at them because it just seems to me that the debt itself becomes the constraint more questions? well we come to the end of the time here and I want to thank all of you for joining us and asking provocative questions and Michael really thank you I wish you well he's got a sequence of meetings with key players this afternoon and I hope you'll be able to give them some solid advice on how to handle our debt problems please join me in thanking Michael thank you very much


first game in the Bronx and the Astros win it four to one behind Garrett Cole seven innings of four hit shutout baseball. Jose Al too big as two for five with a home run. So the Astros take a 2-1 series lead. Great to have you with us here on the post game. Bob Lorenz, Buck Showalter, John Flaherty and Jack Curry with you. This one came down to Garrett Cole. Not probably Jack at his best and the Yankees wasting some opportunities against him. Right Bob throughout the pregame we talked about how Garrett Cole was going to be a challenging pitcher for the Yankees to try and beat and he absolutely was but there's another part of the story today. Yes Cole had seven scoreless innings but the Yankees are going to lament all the opportunities they had to get to Cole.  I think what the Yankees are going to see in their sleep are those missed opportunities those chances they had to maybe make Cole feel uncomfortable where they didn't do that. Yeah I always write down during the game some of the mistakes that maybe they got that they could have done some damage. There was a few hanging sliders mixed in there are a few fastballs that maybe they could have done some damage but when you create all that traffic he walked five in this game you had opportunities you had him probably in the spot that you wanted him. You're going to go home tonight saying we missed so many chances and then I go to that seventh inning where the Astros added on a few. Adavino coming in struggling can't control a running game and the Houston Astros proved they have some power obviously but in that seventh inning manufactured a few runs it really was a difference. Yeah I never really felt like he was in distress even there was traffic out there. I thought the command and the walk total was dictated a little bit by they missed four or five pitches on him that could he had it so six in a row they supposedly threw balls to which I thought were strikes but even though he's got traffic out there you never felt like he was in a lot of distress one because he's got great stuff and so many since presentation but the way he presented himself I thought he handled the atmosphere as the way you expect a great pitcher to handle it. After they left Houston we said they're going to have to the Yankees beat other Gary Cole or Justin Verlander I guess what makes this one frustrating Jack is it was a winnable game against Gary Cole it was still two nothing going into the seventh. The weight continues for a potential win against Verlander and Cole and now this is two opportunities that they've had because Flash said it well earlier in the day that you want the same script from game two you want the chance to have a chance to beat the Astros with your bullpen the Yankees never even got to that in game three Severino's had struggled early he did not have a slider and gave up a couple of home runs on the slider but give Severino credit that he hung in there and kept us at a two to nothing game he didn't have his best stuff either but he kept the Yankee bats within a distance do some damage and then Dita Gregorius almost does with a potential three run homer a ball that lands a few feet away from being a three run homer and the Yankees are just going to remember this as a lost opportunity you got to give Cole credit for this that long layover a long break he came back in the sixth and the seventh and was as good as he was the whole night I think the Yankees are maybe thinking he maybe would get out of there with that long layoff he got better as that game went on where Severino when he came back out on the mound clearly was a compromise pitcher and they had to go to the bullpen I was also a little surprised Aaron Boone patient going to the bullpen right Severino through a ton of pitches in this ball game and Aaron Boone showing a little more patience I think Severino got better I think the key was he gave up two solo home runs he gave his team a team a chance to stay engaged to Cole as tough as that was it just that he never what there ever was a break in the army kept waiting for that anywhere got away from it might have got away from some command here and there but the good swings on him squaring guys up you see the just miss fly balls oh I just miss it oh I just the great pitchers you have that because they had that late life that little movement the breaking ball has a little more finish you don't quite square it up on the barrel it goes through the warning track instead in the seats


Welcome back everyone. This is Brian. In this episode, we're going to talk about decorators and no, it's not about making things prettier, although it does look a little better on the screen. So everything in Python is an object that means even functions can be used as objects. And that's really what decorators going to demonstrate. We can do some really cool things at the heart decorator takes a function, add some functionality and returns it keyword returns it. All right, let's dive in and take a look. So I'm going to do a decorator, and I'm going to do it wrong. I'm going to do it intentionally wrong to show you how decorators actually function. So we're going to say def and let's say test deck or radar. And I want to give it a function. Notice how that's just a variable. That's because everything in Python is an object. So say print or then we're going to actually call that function.  And it is actually a reference to a function. That's because you can pass functions back and forth like variables. So it just simply says before, color function and after. So let's go ahead and say run. And nothing happens because we didn't call this function. Now let's introduce the concept of a decorator. So I'm going to say def do stuff. And let's go ahead and say print doing stuff. Now if you look at these two functions, they're very basic. I mean, this is very easy to understand you have a function that has a function as a parameter, we're going to take that argument and then call it inside. So it's just, you know, calling another function. So we've got our do stuff. Now what a decorator is meant to do is say something like this F equals. So we're going to get some function. And we're going to say test decorator, do stuff. That's really what a decorator is meant to replace. So let's get rid of that. And let's call the decorator. And this is where a lot of newbies really, really stumble. I want to say test decorator. It's really that simple to create a decorator. You just have an at symbol with the name of the function over whatever function you want to decorate. Now there is a sneaky little problem here. This tech test decorator is not returning something. So when I run this, guess what happens. And I'm going to go ahead and clear this out just so you can see it. Did you catch the problem? We never called either of these functions, but yet it executed. And that's because what Python's doing under the hood is it's taking this and saying at test decorator, it's going to take this and put it right here and then just immediately call it. So the code's getting executed even though we did not directly execute the code. That's a fundamental newbie mistake. So be very mindful of that. Let's take a look at an example of a real decorator. We're going to do this the correct way. And it's very, very similar. I'm going to say def and I want to make bold. We're going to follow just kind of the same pattern here. And then I'm going to define an inner function. Now before I do anything, I'm going to immediately return that inner function without calling it. So really what I'm doing is I'm passing a variable back. Very, very, very important. You just kind of understand that concept of what we're doing here. We're making a function. And we have a function inside of a function and we're returning the inter function. So in the inner function here, I'm going to go ahead and just pretty much take the same pattern here. So now we have a before and an after and I'm going to, because we're making this bold, we're just going to say we're working with like some HTML. So we're just going to do the different codes for HTML. If you don't know HTML, basically what we're saying is start making this bold, stop making this bold. It's really all that is. All right. So now we can take that and say death print name, capitalize that just so it looks a little better there. And then we're just going to go ahead and print whatever your name is. Now we've learned from the last segment here that the at symbol with the function name is the actual decorator. So I'm going to just copy that name, go at and then make bold. Now watch what happens when I run this, we're going to see this up here, execute, but we don't actually see the Brian Karens. So really what we're doing here is we're making an equivalent to, and I'm going to copy some stuff on the screen, or just say off the screen. We're saying at make bold is equal to function equals make bold print name, and then calling that function. But that function call is just returning this inner function. If that seems really confusing, think of it this way. At make bold. So we're saying make bold, take this function as the variable. And then we're going to say inner is going to be print, call our function, print, and then return the inner without actually calling it. So now we have this variable we can work with. Man, that seems super, super confusing. But in reality, it's very easy to work with here. Now we can just say something like this, print name and call our function. And under the hood, remember what's going to happen is it's going to go through all of this decorator, return this inner. And when we call print name, it's actually going to call make bold, and then call this code gets kind of confusing, but the results are pretty astounding. Okay, just in case you need a quick, quick recap. At symbol means we're using a decorator, we're calling this function, we're returning this to the function as the parameter. And then the inner function is going to run some code, and we're just going to return that inner function as a variable. So essentially, basically what we're doing here is that we're calling that inner function, but we don't have direct access to it. And that's why people get so hung up on decorators. Once you wrap your head around that, they're actually pretty simple. Okay, if this was not confusing enough, now let's make it even more confusing. What if we wanted to pass parameters to this? How would we go about passing parameters to all these, you know, functions and inner functions and all this fun stuff. So that's what we're really going to look at in this little section here, decorators with parameters. So let's say we want to make some sort of function called divide. And this function should shockingly divide things. So the problem we have with Python is, well, it is very weak typed. And what I mean by that is, what is A and B is an integer? Is it a float? Is it a string? Is it a class? For example, can you divide A by cats? That's a really good question. So what we would need to do is something like that's print, A divided by B. Now if we were to, and I'm going to just put some stuff out here, copy and paste, what do you think's going to happen if we do 100 divided by three? What about 100 divided by zero, you're gonna get division by zero error. What about 100 divided by a string? Well, you're gonna get some really bad results. Let's just run this and see. Yep. Division by zero. Boom. Let's just try to bypass that. And let's do it again. And uh-oh, unsupported operand type in string. Super, super frustrating. So what we want is a decorator that will check to make sure if we can even do the division, and if we can to actually divide and return the result, which means we're now doing type checking, and we're passing parameters. Let's go ahead and make it real quick. So I'm gonna say def and let's call this num check. I almost wanted to call it num chuck, but gotta behave. All right. So num check short for number check. This is going to be our decorator, and we're going to have two functions in here. I'm gonna say def check int. Doesn't necessarily need to be an int, but just as an example, we're going to check to make sure it's an integer. And I'm going to immediately pass. And then let's say def enter. And in our inner, we want an X and a Y. And you notice this has a defined number of parameters. What's going on here is we are matching the function call. See how we have one two and one two. So pretty much we have two parameters. We want to make sure we're lining up with two parameters. We're going to show you how to get around this in the next segment, but I want to show you how to just pass the parameters. And that's why I have this at a specific number, one two and one two. All right. So in our inner, I'm going to say simply if not check int. And I want to check X. And we'll say or not check int. I want to check Y because we're going to check both of those make sure they're both numbers. If they're not, we're going to return. Now notice how we're not returning inner. We're just returning. So it's going to take no action whatsoever. Then we're going to drop out here and say otherwise, we're going to return the function. And if you're confused about where we're getting that is the parameter for our decorator right up here. And we're going to return X comma Y. Now let's go ahead and return our inner.  I'm sorry, it just is. I love decorators, but these are so confusing. So once we make this a decorator, and let's actually just do that right now. So Python is going to say num check. And then it's going to say divide past divide to this, which is going to go down into our inner and all this other stuff. And it's going to get passed around like hot potato and try to figure it out. That's confusing. That is so ridiculously confusing. Let's go ahead and do our check int. And then we'll step through this whole thing step by step, make sure we understand the logic here. So we'll say if is instance, zero comma int. So we're just doing some type checking here, some real basic type checking. And then beyond type checking, we had that division by zero. So if it's an integer, we want to make sure if O equals zero, we'll let the user know something happened here, print and not divide by zero. Then we just want to return false. Okay. If we've gotten past all this, let's drop out here, we're going to go to return true because it is not zero and it is an integer. So we should be able to do some sort of division. If we've gotten to this point, and we haven't already returned true or false, I'm just going to say print, this is not a number. That'll get rid of our pesky string problem. Then we're going to go ahead and return false. Okay. So the base logic here, man, fasten your seatbelt for this one. So our decorator is going to be num check some function. Our inner is going to come down here and say, okay, we've got two parameters x and y, if not, and then check in on x and check in on y, check in is going to say, is it an integer? If it is an integer, then we're going to say is it zero? If it's zero, then we're going to return false. However, if it is an integer, we're going to return true. And if we have not returned out of there, we're going to return false and say it's not a number. There's probably a vastly prettier way of doing this. I was just hashing out some code real fast. Once we've said, okay, it is not into integer, or it does not pass this check in, then we're just going to return nothing. However, if we are able to, then we're going to return the function x, y, which means it's going to actually do our division for us. Wow, that's crazy. All right. We've got our decorator in there. Let's just test it with 103 save run. Sure enough, it returns 3.3 repeating. Let's try our division by zero cannot divide by zero. Cannot divide by zero. So it caught that. Now let's try to divide 100 by cat. And cat is not a number. Very cool, very functional design. Without having to do a whole lot of back and forth, we can just simply define a decorator. And then, you guessed it, use it. And we can use this over and over and over again. It makes it so simple once we get to this point. Okay, the last little section there was really, really confusing. But the main takeaway here is that you can get some really complex functionality out of a simple decorator. The big problem was we had two arguments and only two. What if we wanted to have an unknown number of arguments and we want to chain them together? Let's take a look. So I'm going to make two decorators, say death and outline. And initially I'm just going to pass. We can take this copy, paste, let's call this list items. Now we're going to make another function and let's call it display. Display is just going to display a variable called message or MSG. Very simple, just going to print it out. Not sure where copy and paste is betrayed me there. There we go. All right, very simple, very easy to understand structure here. We're going to take these two and chain them together. And when I say chain, what we're talking about is something like this. So we've created a chain and it looks like a chain because you got these little at symbols or links in the chain. And these could just to kind of give you a graphical representation here. It looks like you have a chain going down the screen. Really, it's first come, first served. So outline will get called first and then list items will get called second. And we could just keep adding and adding and adding if we wanted to. But this is the main reason why we have to return our inner function. So let's start fleshing these things out. Now I want to say args, which stands for zero or more arguments or zero or more keyword args. If you skip that video, I highly encourage you to go back through the playlist. Link is down below. Watch the video and understand the difference between args and keyword args. And then print, we're just going to print out tilde times 20. Because outline is going to shockingly just outline whatever we put out here. Now we're going to call our function with our star args in keyword args. Once we've gotten to this point, very simple, just return our inner. We've got our first decorator pretty much done. All it's going to do is outline our function. Very straightforward. Now list items is a little bit more confusing, but not by much. First off, let's go down here and fix this MSG. There we go. Make it a little more apparent what display is actually going to do. So we're going to depth inner and we can just go right up here and grab this. Save us a smidge of typing. There we go. So first thing we're going to do is just, well, I must have clicked something. There we go. First thing we're going to do is just call our function. Then we want to be able to list it out. But before we do that, I'm going to just print f and we're going to say args equals. And I just want to see what Python is actually handing us. That way you can kind of wrap your head around this. We can do the same thing with our keyword args. And let's go ahead and return our inner. So now we have two different decorators that do two totally different things. We can then just call our function and see them in action. So we got hello world args, args, and this should actually be keyword args. Notice what's happening.  So basically list items is being called inside of outline. That's part of the chaining. So outlining is being called first. And because we are now passing this other decorator, it's now forming that chain. See how that works? Here is our end right here. And to just kind of break that up, we could actually turn this into like a plus symbol or something. Just so you can see the start and the finish. Till now plus symbols start, finish. Very, very interesting the way that works. I absolutely love it. But notice right off the bat here, args is a tuple. Keyword args is a dictionary. Okay, so that tells us exactly how we need to iterate through these things. So I'm going to say for X in args, let's go ahead and print. And we're going to format that format that. And I want arg equals and then X. And we can do something very, very similar for our keyword args, except for that's a dictionary. So we're going to do a key value pair. What I just did on the screen looks like black magic, go back in the playlist, link is down below and watch the video on the for loop on dictionaries. And we're going to do the keyword args dot items. And then we're going to say key equals X. And value equals actually not X. Sorry about that. He is K and value is V. There we go. Save run. And sure enough, our hello world. Notice how it's not got anything in this dictionary here is because we have no keyword args. See, we're just adding a normal argument. So let's go ahead and do something a little different here. We're say that birthday, and I want some keyword args name equals whatever, and age equals zero. And I'm going to say print, format, happy birthday, whatever their name is.  Now let's go ahead and call our function with the keyword arguments. And we can go ahead and just reuse these decorators. I'm just going to literally copy and paste. Notice how they're two different functions to two totally different things. And they even have different parameter types. But we can use the same decorators. Let's see it in action. Happy birthday, Brian.  And now we have no args, but we have this nice dictionary. And we get the key and value out of that. And if I just go up, you can see how it fired off both of them. And everything's working as expected. So decorators main takeaway here is, well, they're complex. And they get really confusing really, really fast. But the biggest takeaway you should really understand from a decorator going all the way back to the very beginning is it's going to call this function right here. And if you don't return your inner function, it's just going to execute the code. So a real decorator looks something like this, you have your function, you've got your decorator, the decorator is going to have an inner function, and you're going to return a variable that points to that inner function. From there, really, the imagination you have is your limit, you can do just about anything you want. And these become highly, highly reusable, and you can make them as simple or as complex as you want. And you can reuse them across many different types of functions. I hope you enjoyed this video, you can find the source code out on github.com. If you need additional help, myself and thousands of other developers are hanging out in the void realms Facebook group. This is a large group with lots of developers and we talk about everything technology related, not just the technology that you just watched. And if you want official training, I do develop courses out on udemy.com. This is official classroom style training. If you go out there and the course you're looking for is just simply not there, drop me a note, I'm either working on it or I will actually develop it. I will put a link down below for all three of those. And as always, help me help you smash that like and subscribe button. The more popular these videos become, the more I'll create and publish out on YouTube. Thank you for watching.


Welcome to TownMeetingTV. Here's 33 years and 33 seconds. It's 7 o'clock and we're on and it's Channel 17. And you can hear me, I think, and the picture quality might not be so good, but it will improve by tomorrow. And allowing people to understand what's going on in their own communities.