Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeClaudi committed Oct 4, 2020
2 parents efb3068 + 2ad00e6 commit de53908
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ You can also use `pyinspect` to print a function's code directly in your termina


# Table of Contents
1. [Installing pyinspect](##Installing pyinspect)
2. [ExamplFinding functionse2](#Findingfunctions)
3. [Third Example](#third-example)
4. [Fourth Example](#fourth-examplehttpwwwfourthexamplecom)
1. [Installing pyinspect](https://github.com/FedeClaudi/pyinspect#installing-pyinspect)
2. [Finding functions](https://github.com/FedeClaudi/pyinspect#finding-functions)
3. [Inspecting functions](https://github.com/FedeClaudi/pyinspect#inspecting-functions)
4. [Tracebacks](https://github.com/FedeClaudi/pyinspect#tracebacks)


## Installing pyinspect
Expand Down Expand Up @@ -75,6 +75,7 @@ methods = pyinspect.search(Console, 'export')
```

Which gives:

<img src='media/find_class_method.png' style='border-radius:8px; box-shadow: 6px 6px 12px rgba(.2, .2, .2, .4)' width=800px></img>


Expand Down Expand Up @@ -102,6 +103,7 @@ pi.showme(pi.search)
```

which yields:

<img src='media/print_function.png' style='border-radius:8px; box-shadow: 6px 6px 12px rgba(.2, .2, .2, .4)' width=800px></img>


Expand All @@ -127,6 +129,7 @@ a + c # this will give an error
```

and this is the traceback:

<img src='media/traceback.png' style='border-radius:8px; box-shadow: 6px 6px 12px rgba(.2, .2, .2, .4)' width=800px></img>

> **note**: although we defined three variables (`a`, `b`, `c`) only two where in the line causing the error (`a + c`). `pyinspect` then highlights `a` and `c` in the traceback as this is what you need to know to fix your bug. If you want `pyinspect` to **only** show the variables in the error line pass `relevant_only=True` to `pi.install_traceback()`
Expand Down

0 comments on commit de53908

Please sign in to comment.