Example error that demonstrates why local vars are so useful

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

No file, test, or entry point is named. Start by locating where opbeans-python defines example errors, then compare the existing examples with the regex and IndexError scenario in the issue. Done means the repository contains a runnable example that demonstrates why inspecting local variables helps diagnose the failure.

Written by the indexing model from the issue text.

Description

Would be lovely to have an example error that shows why local variables are so useful. For example when debugging why some regex doesn't match. Let's say the developer assumed the regex would capture a group and then do something with it?

phone_num = self.cleaned_data['phone']
country_code = phone_num.match(phone_num, '$(\+\d+)\-').groups[1]

throws an IndexError because there's no country code in the telephone number.

Dominant language
Python
Stars
7
Forks
14
Avg merge
14h 16m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elastic/opbeans-python

All issues in elastic/opbeans-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.