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.

The del statement has no effect

See original GitHub issue

From the Brython console:

Brython 3.7.0 on Netscape 5.0 (Windows)
>>> v

NameError: name 'v' is not defined
Traceback (most recent call last):
  module __main__ line 129, in myKeyPress
    _ = editor_ns['_'] = eval(currentLine, editor_ns)
  module <module> line 1
    v
>>> v = 1
>>> v
1
>>> del v
>>> v
1

But after del v accessing v should raise a NameError again.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
PierreQuentelcommented, Jul 3, 2019

My mistake, sorry : when I tested your example I removed the parenthesis:

del hello["a"]

instead of

del(hello["a"])

and the bug happened with the parenthesis.

Thanks for the report !

0reactions
darthglowballcommented, Jul 2, 2019

To be fair, before suspecting Chromium, I’ll try the javascript equivalent of Python’s del(). What javascript equivalent does Brython use for del()?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Statement has no effect — CodeQL query help documentation
An expression statement without side effects is just clutter. It confuses the reader and may have a slight impact on performance. Recommendation¶. First ......
Read more >
Unable to remove object after using del statement in python
For this, all I would have to do say del root. This has no effect at all on the tree and the value...
Read more >
MSC12-C. Detect and remove code that has no effect
Code that has no effect or is never executed (that is, dead or unreachable code) is typically the result of a coding error...
Read more >
Statement seems to have no effect
The message "statement seems to have no effect" is being shown as an allert for the syntax checking in PyCharm. I want to...
Read more >
7. Simple statements — Python 3.11.1 documentation
A simple statement is comprised within a single logical line. Several simple statements may occur on a single line separated by semicolons.
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