|
338 | 338 |
|
339 | 339 | 00:11:50 Right.
|
340 | 340 |
|
341 |
| -00:11:50 Like why does plus plus and C do different things if it's in the front or the back and what's the difference? |
| 341 | +00:11:50 Like why does C++ and C do different things if it's in the front or the back and what's the difference? |
342 | 342 |
|
343 | 343 | 00:11:56 Like, unless you know, prefix versus suffix increment and the difference in terms of referencing the pointer and all this crazy stuff, like you're not going to say pick up on the difference unless you run your code versus something where you can just look at it and just learn on the spot.
|
344 | 344 |
|
|
366 | 366 |
|
367 | 367 | 00:12:57 And you're just like, yeah, it's a little better, but it's why do we have so many ways if you're going to be that right.
|
368 | 368 |
|
369 |
| -00:13:02 And so when I at least look at Python compared to like my background in C plus plus or in C# or JavaScript, I feel like it's comfortable. |
| 369 | +00:13:02 And so when I at least look at Python compared to like my background in C++ or in C# or JavaScript, I feel like it's comfortable. |
370 | 370 |
|
371 | 371 | 00:13:11 It's not stale, but it's not, we don't have five ways to do properties.
|
372 | 372 |
|
|
472 | 472 |
|
473 | 473 | 00:17:10 I luckily the tooling around web assembly got far enough along.
|
474 | 474 |
|
475 |
| -00:17:14 Pyodites continue to do well in the browser. |
| 475 | +00:17:14 Pyodides continue to do well in the browser. |
476 | 476 |
|
477 | 477 | 00:17:16 I've been working on the web assembly, the system interface, Wazzy side of things, and that's been going pretty well.
|
478 | 478 |
|
|
640 | 640 |
|
641 | 641 | 00:22:08 It's just what happens then, right?
|
642 | 642 |
|
643 |
| -00:22:11 Like in those other ones, they, they jet compile to machine instructions. |
| 643 | +00:22:11 Like in those other ones, they, they jit compile to machine instructions. |
644 | 644 |
|
645 | 645 | 00:22:14 Here it goes through like the big C eval loop and delegates to some internal C operations.
|
646 | 646 |
|
|
704 | 704 |
|
705 | 705 | 00:24:58 So it seems so simple.
|
706 | 706 |
|
707 |
| -00:25:00 You just object dot attribute object dot field, whatever. |
| 707 | +00:25:00 You just object.attribute object.field, whatever. |
708 | 708 |
|
709 | 709 | 00:25:03 But it turns out there's just so many variations and so much going on down here, and I don't necessarily want you to go through all the details cause it's pretty, some of it's pretty intense C and like a lot of it, you know, optimizations and stuff, but like just give people a sense of what actually happens down, down in the guts when you try to do that.
|
710 | 710 |
|
|
720 | 720 |
|
721 | 721 | 00:25:40 And then at the C level, we have to check whether or not what you gave it, right?
|
722 | 722 |
|
723 |
| -00:25:44 Because there's like a Python level, the C code, all types to what's called the two PI object, which is basically a massive struct in C that represents any and all Python objects. |
| 723 | +00:25:44 Because there's like a Python level, the C code, all types to what's called the two Py object, which is basically a massive struct in C that represents any and all Python objects. |
724 | 724 |
|
725 | 725 | 00:25:55 So even at the C level, we don't know if you gave us a string or an integer or what did you give us for the name of the attribute that you want?
|
726 | 726 |
|
|
742 | 742 |
|
743 | 743 | 00:26:24 And then effectively just bubbles all down to the C API where a lot of this stuff gets exposed in its own way.
|
744 | 744 |
|
745 |
| -00:26:29 And specifically in this case, it ends up calling PI objects, get adder. |
| 745 | +00:26:29 And specifically in this case, it ends up calling Py objects, get adder. |
746 | 746 |
|
747 | 747 | 00:26:33 Yeah.
|
748 | 748 |
|
749 | 749 | 00:26:33 And I think another thing that's pretty interesting here is it's not always just a value, right?
|
750 | 750 |
|
751 |
| -00:26:38 That object dot adder, that adder could be a property. |
| 751 | +00:26:38 That object.adder, that adder could be a property. |
752 | 752 |
|
753 | 753 | 00:26:41 That adder could be a descriptor, which I guess is a generalization of a property.
|
754 | 754 |
|
|
998 | 998 |
|
999 | 999 | 00:34:28 That's way simpler for the really common cases that could be optimized extremely fast because you give away some flexibility and then the interpreter can make assumptions.
|
1000 | 1000 |
|
1001 |
| -00:34:41 Pypy can make assumptions, et cetera, et cetera. |
| 1001 | +00:34:41 PyPI can make assumptions, et cetera, et cetera. |
1002 | 1002 |
|
1003 | 1003 | 00:34:44 And would there be enough wins on that to warrant doing it right?
|
1004 | 1004 |
|
|
1610 | 1610 |
|
1611 | 1611 | 00:52:33 Yeah.
|
1612 | 1612 |
|
1613 |
| -00:52:33 From dot, dot a import B kind of stuff. |
| 1613 | +00:52:33 From dot, dot a import lib kind of stuff. |
1614 | 1614 |
|
1615 | 1615 | 00:52:35 Like there's a surprising amount of information you need to pass in to do those kinds of resolutions and such from imports, right?
|
1616 | 1616 |
|
|
1634 | 1634 |
|
1635 | 1635 | 00:53:18 It's borderline implementation detail on this kind of thing.
|
1636 | 1636 |
|
1637 |
| -00:53:21 This is why you should use import lib dot import module, right? |
| 1637 | +00:53:21 This is why you should use import lib.import module, right? |
1638 | 1638 |
|
1639 | 1639 | 00:53:24 That function exists specifically and I designed it specifically for those cases where you need to do dynamic imports and you want a very clean, simple API because like the return type for dunder import very much is designed for the upcode so that whether you're doing an import something or from something, import other thing, right?
|
1640 | 1640 |
|
|
1782 | 1782 |
|
1783 | 1783 | 00:57:23 Yeah, it's covered in the in-place binary operator, augmented assignment post.
|
1784 | 1784 |
|
1785 |
| -00:57:29 So, you know how you can do a plus equals B and it's like doing a equals a plus B. |
| 1785 | +00:57:29 So, you know how you can do A plus equals B and it's like doing A equals A plus B. |
1786 | 1786 |
|
1787 | 1787 | 00:57:34 Yeah.
|
1788 | 1788 |
|
1789 | 1789 | 00:57:34 Yeah.
|
1790 | 1790 |
|
1791 |
| -00:57:35 So it turned out it was broken for pal. |
| 1791 | +00:57:35 So it turned out it was broken for call. |
1792 | 1792 |
|
1793 | 1793 | 00:57:36 So when you know, when you could do a star, star B that's a to the B power.
|
1794 | 1794 |
|
|
2164 | 2164 |
|
2165 | 2165 | 01:06:33 We should be right at the top.
|
2166 | 2166 |
|
2167 |
| -01:06:35 You can also find the iTunes feed at slash iTunes, the Google play feed at slash play and the direct RSS feed at slash RSS on talkpython.fm. |
| 2167 | +01:06:35 You can also find the iTunes feed at /iTunes, the Google play feed at /play and the direct RSS feed at /RSS on talkpython.fm. |
2168 | 2168 |
|
2169 | 2169 | 01:06:44 We're live streaming.
|
2170 | 2170 |
|
|
2183 | 2183 | 01:07:02 [Music]
|
2184 | 2184 |
|
2185 | 2185 | 01:07:17 [Music]
|
2186 |
| - |
0 commit comments