You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-252/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ print(my_string)
62
62
63
63
## Non-Compliant Code Example - Invalid value handling
64
64
65
-
Return values are also important when they may be used as an alternative to raising exceptions. `str.find()`, unlike `str.index()`return -1 [[Python Docs - str.find](https://docs.python.org/3/library/stdtypes.html#str.find)] instead of raising a `ValueError`[[Python Docs - str.index](https://docs.python.org/3/library/stdtypes.html#str.index)] when it cannot find the given sub-string.
65
+
Return values are also important when they may be used as an alternative to raising exceptions. `str.find()`, unlike `str.index()`returns -1 [[Python Docs - str.find](https://docs.python.org/3/library/stdtypes.html#str.find)] instead of raising a `ValueError`[[Python Docs - str.index](https://docs.python.org/3/library/stdtypes.html#str.index)] when it cannot find the given sub-string.
66
66
This non-compliant code example shows that using this value will point to the last element of the string regardless of what it is.
0 commit comments