Skip to content

fixes #276#277

Open
norweeg wants to merge 1 commit intoWestHealth:masterfrom
norweeg:fix-#276
Open

fixes #276#277
norweeg wants to merge 1 commit intoWestHealth:masterfrom
norweeg:fix-#276

Conversation

@norweeg
Copy link

@norweeg norweeg commented Apr 3, 2024

  • removes unnecessary and silent type conversion of numeric node IDs
  • add_edges using node IDs' original type no longer raises exception
  • refactored coincidental inappropriate usage of assert for type-checking/control logic in add_node and add_nodes to raise appropriate exceptions instead

* removes unnecessary and silent type conversion of numeric node IDs
* add_edges using node IDs' original type no longer raises exception
* refactored coincidental inappropriate usage of assert for type-checking/control logic in add_node and add_nodes to raise appropriate exceptions instead
@norweeg
Copy link
Author

norweeg commented Apr 3, 2024

general comment: I found the code rife with inappropriate and unsafe usage of assert as control logic/type checking. That should be completely refactored out because this library will fail spectacularly if run when __debug__ is False such as when running the interpreter with the -O flag or if the environment variable PYTHONOPTIMIZE is set

https://snyk.io/blog/the-dangers-of-assert-in-python/

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

Comments