Skip to content

Add __repr__ to core classes#123

Merged
ad-m merged 1 commit intomasterfrom
add-repr-methods
Mar 7, 2026
Merged

Add __repr__ to core classes#123
ad-m merged 1 commit intomasterfrom
add-repr-methods

Conversation

@ad-m
Copy link
Owner

@ad-m ad-m commented Mar 7, 2026

Summary

  • Add __repr__ to BaseTask, Job, and AnticaptchaClient for better debugging and REPL experience
  • BaseTask.__repr__ shows class name and public non-None attributes (inherited by all task subclasses)
  • Job.__repr__ shows task_id and last known status
  • AnticaptchaClient.__repr__ shows the configured host
>>> client
<AnticaptchaClient host='api.anti-captcha.com'>

>>> task
<RecaptchaV2TaskProxyless websiteURL='https://example.com' websiteKey='6Le...'>

>>> job
<Job task_id=12345 status='ready'>

Test plan

  • All existing tests pass (72 passed)
  • Manually verified repr output for all three classes

🤖 Generated with Claude Code

Improves debugging and REPL experience by showing useful info instead
of unhelpful <object at 0x...> output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ad-m ad-m force-pushed the add-repr-methods branch from c2f29a5 to ccda0c0 Compare March 7, 2026 12:58
@ad-m ad-m merged commit ca02a00 into master Mar 7, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant