Skip to content

Commit fe3fd33

Browse files
author
hartsantler
committed
fixed README
1 parent d7c3753 commit fe3fd33

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,15 @@ b = ("1","2","3")
449449
D = { a: 'hello', b: 'world' }
450450
D[ a ] == 'hello' ## OK
451451
D[ b ] == 'world' ## OK
452+
```
452453

453454
5. AttributeError and KeyError are only raised in javascript mode when inside a block that catches those errors.
454455
In the default python mode these errors will always be thrown, and halt the program.
455456
```
456457
pythonjs.configure(javascript=True)
457458
a = {}
458-
b = a['xxx'] # this will not throw any error
459+
# this will not throw any error
460+
b = a['xxx']
461+
# this works as expected, "b" will be set to "my-default"
459462
b = a['xxx'] except KeyError: 'my-default'
460463
```

0 commit comments

Comments
 (0)