Skip to content

Use context managers instead of unrolled scopes #429

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

Closed
wants to merge 12 commits into from

Conversation

agoose77
Copy link
Contributor

@agoose77 agoose77 commented Jul 6, 2018

Depends upon GH-428.

I've seen #158 which suggests that this is a deliberate feature. Perhaps then this isn't appropriate.

However, in https://github.com./agoose77/jsonschema/blob/master/jsonschema/_validators.py#L304 we have more complicated logic where we look for the contextmanager, and use it if available, otherwise defaulting to an unrolled loop. As far as I can tell, this is to facilitate the mock ref resolver which only provides the context manager. If performance is still a concern, I suggest we eliminate one branch.

agoose77 added 12 commits July 5, 2018 18:45
@Julian
Copy link
Member

Julian commented Jul 6, 2018

See my comments on the other PR which would likely apply here too, it's certainly harder to deal with this if it's dependent on the other one, but the one change I can see here does break backwards compatibility as well, so depending on what the goal is here it can't be merged as-is, but possibly there's a solution that covers whatever the goal is.

@agoose77
Copy link
Contributor Author

agoose77 commented Jul 6, 2018

Leave this for now.

@agoose77 agoose77 closed this Jul 6, 2018
Julian added a commit that referenced this pull request Jun 25, 2022
f0f619d19 Merge pull request #560 from json-schema-org/ether/fix-383
fa791ada9 remove tests that are not valid for draft7
0f341dca0 Merge pull request #429 from notEthan/decimal_minItems
32ec6305c test validation of keywords which expect integers when their value has a decimal
547330dd6 Tweak the markdown table syntax in the README.
28ed3022c Restructure the README further.
45d6e5e7f README: Add new content and update the structure
4de0966a7 Merge pull request #558 from yakimun/replace-definitions-with-defs
aad0f350a Replace definitions with  for 2019 and later drafts
0b777ffa2 Merge branch 'ether/more-anchor-and-id-tests'
d593591d7 Forward port the just-added tests to 2020 and next.
e157bc0b7 squash: use a unique $id to prevent namespace collisions across tests
1d5583de6 some tests of the interactions between $id, $anchor and $ref
07c45c0d7 Restore the dependencies tests as optional for 2019, 2020, and next

git-subtree-dir: json
git-subtree-split: f0f619d19696a81f7683116f707a51c34150d28f
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.

2 participants