Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #276 #277

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fixes #276 #277

wants to merge 1 commit into from

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.

None yet

1 participant