question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add __repr__() to all classes for easier debugging

See original GitHub issue

The following don’t help me much when I’m trying to debug broken tests:

  • <packit.api.PackitAPI object at 0x7fa7f1eada10>
  • <packit.upstream.Upstream object at 0x7fa7f1ea7710>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
csomhcommented, Apr 23, 2020

you need to add -s as an option for pytest in make check and then just place the breakpoint in the code somwhere: import ipdb; ipdb.set_trace()

With Python 3.7 you can use the breakpoint() builtin.

0reactions
stale[bot]commented, Jun 22, 2020

This issue has been marked as stale because it hasn’t seen any activity for the last 60 days.

Stale issues are closed after 14 days, unless the label is removed by a maintainer or someone comments on it.

This is done in order to ensure that open issues are still relevant.

Thank you for your contribution! 🦄 🚀 🤖

(Note: issues labeled with pinned, security, bug or EPIC are never marked as stale.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enhance Your Python Classes with the __repr__() Method
Enhance Your Python Classes with the __repr__() Method. Make your code easier to debug by adding string representations of your Python classes.
Read more >
What is the __repr__ method in Python? - Educative.io
In Python, __repr__ is a special method used to represent a class's objects as a string. __repr__ is called by the repr() built-in...
Read more >
Python repr for classes - Stack Overflow
The way I see it, the repr function should return a string that allows you to reproduce the object: in an arbitrary context...
Read more >
Python __str__() and __repr__() functions | DigitalOcean
Let's look at a built-in class where both __str__ and __repr__ functions are defined. >>> import datetime >>> now = datetime.datetime.now() >>> ...
Read more >
reprlib — Alternate repr() implementation — Python 3.11.1 ...
Class which provides formatting services useful in implementing functions similar to the built-in repr() ; size limits for different object types are added...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found