Mastering PyCharm Transcripts
Chapter: The Editor
Lecture: Find usages of functions and other symbols

Login or purchase this course to watch this video and the rest of the course contents.
0:01 One of the really important things to do
0:03 before you start changing code is understand where and how it's used
0:06 and sometimes you're just trying to decide
0:08 is this used at all— it doesn't look like this is used
0:13 but I don't really want to delete it because what if it is?
0:15 So we can use find usages to answer both those questions and more,
0:21 so we can come down here and say right click
0:24 on this function get defensive roll and click find usages
0:26 and we get this sort of fine dialogue at the bottom
0:30 and it says oh well, the get defensive roll is used in a bunch of places,
0:34 the dragon uses it, the small animal uses it the wizard uses it within its attack
0:37 both for itself and for the creature that it is battling with.
0:43 So then you can quickly understand where this function is used,
0:46 how it's used, if you're going to change the signature
0:49 or just want to know who is actually calling this function
0:53 find usages, because PyCharm understands
0:56 potentially hundreds of Python files and packages
1:00 used across your entire project,
1:03 this is much better than just hoping
1:06 or maybe doing a search for get defensive roll as a string,
1:10 because it understands the abstract syntax tree
1:13 and it literally knows where is being used
1:16 it's not just doing like a fancy find in text sort of thing,
1:21 it's actually understanding the way the code is working together
1:24 and then it navigates that abstract syntax tree.