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

feat: more type hints for rdflib.plugins.sparql #2268

Merged
merged 1 commit into from
Mar 12, 2023

Commits on Mar 12, 2023

  1. feat: more type hints for rdflib.plugins.sparql

    A bit of a roundabout reason why this matters now, but basically:
    
    I want to add examples for securing RDFLib with `sys.addaudithook`
    and `urllib.request.install_opener`. I also want to be sure examples
    are actually valid, and runnable, so I was adding static analysis
    and simple execution of examples to our CI.
    
    During this I noticed that examples use `initBindings` with
    `Dict[str,...]`, which was not valid according to mypy, but then after
    some investigation I realized the type hints in some places were too
    strict.
    
    So the main impetus for this is actually to relax the type hints in
    `rdflib.graph`, but to ensure this is valid I'm adding a bunch of type
    hints I had saved up to `rdflib.plugins.sparql`.
    
    Even though this PR looks big, it has no runtime changes.
    aucampia committed Mar 12, 2023
    Configuration menu
    Copy the full SHA
    176d4d3 View commit details
    Browse the repository at this point in the history