Effective PyCharm Transcripts
Chapter: Tool windows
Lecture: File structure

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Let's talk about navigating around files one more time. There's all these different aspects that we like to explore and these tool windows are really
0:07 really helpful for them over here. We've got episodes as a type, we've got episodes as a list or a dictionary of those types.
0:17 We've got some of these functions here that we might want to navigate through and this
0:22 file is pretty small, but maybe you want to get a quick overview just what is in this file, so we can come on down here to this structure,
0:30 then we can quickly jump around like what, where is the max Id boom is right there, where is the episodes dictionary? That's right,
0:36 there was episodes type right there, so this is a really cool way to go and navigate around through the file.
0:44 This one is fairly simple, there's no classes, there's just a couple of methods, a couple of variables, so maybe you wouldn't really use it there.
0:52 Remember that actors file. We had all the actors from the wizard, D&D. Game, we've got the wizard, the small animal, the dragon creature.
1:00 This gets more interesting. So notice over here we have our classes and if we expand this out for these things, we can see as you just touch them.
1:08 Here's the creature is the dragon that derives from creature in navigate around. We can also see here's where the level is defined right online,
1:17 seven. It's hard to see where the cursor is. So when we click that it takes us there. When you click this takes us over the line.
1:23 Six, so we can see immediately where is that field that belongs to that class
1:27 live. Right? So down here we see that small creature is overriding get defensive role, click on that, we get small creatures defensive role,
1:36 super super cool. Now with classes it might be interesting to just have this view So you know imagine we were in our own file,
1:45 Act, I can open that up here if we have our dragon and its own file, right in this case we don't have any other thing.
1:55 Then the structure only shows what the dragon itself defines its breath,
1:59 fire, scariness and it's get defensive role but this button right here will show us the entire type hierarchy for this so check this out,
2:10 look how cool this is. So dragon drives from creature creature drives from object. So these things are the items that come from dragon.
2:19 But down here, this rapper, this comfortable creature in another file,
2:23 This level comes from creature over there and then we can go further down into the
2:27 hierarchy of like well where's Dunder dict define that's defined in the built in which is
2:33 inside of just object so we can turn on for back in our dragon here we can turn on show us the type hierarchy as well.
2:41 Sometimes because of all the magic methods of Python data model there,
2:46 this can be a little intense so don't sort alphabetically because you get sort of this
2:51 you know my stuff and then the next level of hierarchy and then the next level, which is probably the right way you can sort of like this.
2:58 But then that becomes, I don't know, that becomes tricky, so really, really useful way to understand type hierarchies,
3:05 how files fit together and navigating large files honestly.


Talk Python's Mastodon Michael Kennedy's Mastodon