Effective 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 before you start changing code is understand where and how it's used
0:07 and sometimes you're just trying to decide is this used at all— it doesn't look like this is used
0:14 but I don't really want to delete it because what if it is? So we can use find usages to answer both those questions and more,
0:22 so we can come down here and say right click on this function get defensive roll and click find usages
0:27 and we get this sort of fine dialogue at the bottom and it says oh well, the get defensive roll is used in a bunch of places,
0:35 the dragon uses it, the small animal uses it the wizard uses it within its attack both for itself and for the creature that it is battling with.
0:44 So then you can quickly understand where this function is used, how it's used, if you're going to change the signature
0:50 or just want to know who is actually calling this function find usages, because PyCharm understands potentially hundreds of Python files and packages
1:01 used across your entire project, this is much better than just hoping or maybe doing a search for get defensive roll as a string,
1:11 because it understands the abstract syntax tree and it literally knows where is being used it's not just doing like a fancy find in text sort of thing,
1:22 it's actually understanding the way the code is working together and then it navigates that abstract syntax tree.


Talk Python's Mastodon Michael Kennedy's Mastodon