GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-40077: Convert _jsonmodule to use PyType_FromSpec. by corona10 · Pull Request #19177 · python/cpython

Conversation

@corona10

@corona10 corona10 commented Mar 26, 2020 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

https://bugs.python.org/issue40077

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@corona10
bpo-40077: Convert _jsonmodule to use PyType_FromSpec.
369b187
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Mar 26, 2020
@bedevere-bot bedevere-bot added the awaiting review label Mar 26, 2020
@corona10
corona10 requested a review from vstinner March 26, 2020 16:26
vstinner
vstinner reviewed Mar 26, 2020
View reviewed changes
Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

corona10 added 2 commits March 27, 2020 02:50
@corona10
bpo-40077: Apply Victor's review part 1
5db609a
@corona10
bpo-40077: Use C99 style
e656cea
@corona10
corona10 requested a review from vstinner March 26, 2020 19:23
vstinner
vstinner reviewed Mar 26, 2020
View reviewed changes
Comment thread Modules/_json.c
encoder_clear(self);
Py_TYPE(self)->tp_free(self);
encoder_clear((PyEncoderObject *)self);
tp->tp_free(self);

@vstinner vstinner Mar 26, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current code is just fine, no? I don't see the value of tp. It seems like it comes from a previous change that you reverted.

Suggested change
tp->tp_free(self);
Py_TYPE(self)->tp_free(self);

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@corona10 corona10 Mar 27, 2020

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vstinner
Py_DECREF(tp);is needed if not test is leaked.
This is why I declared tp ;)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@corona10 corona10 Mar 27, 2020

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_json leaked [114, 114, 114] references, sum=342
test_json failed in 35.6 sec

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_json.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

corona10 added 2 commits March 27, 2020 11:57
@corona10
bpo-40077: Apply Victor's code review.
e2d444d
@corona10
bpo-40077: nit
5b0b7b2
@corona10
corona10 requested a review from vstinner March 27, 2020 03:16
@corona10

corona10 commented Mar 27, 2020

Copy link
Copy Markdown
Member Author

@vstinner
Thanks for the review. :)
I 've applied all of your comment except #19177 (comment) :)

Please take a look

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@corona10
bpo-40077: update
f5798c1
@vstinner
vstinner merged commit 33f15a1 into python:master Mar 27, 2020
@bedevere-bot bedevere-bot removed the awaiting review label Mar 27, 2020
@vstinner

vstinner commented Mar 27, 2020

Copy link
Copy Markdown
Member

Thanks @corona10, this change was interesting. I learnt a few things :-) I merged your PR, but I completed the commit message to elaborate on changes that you wrote.

corona10 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Apr 1, 2020 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

I mentioned the removed assertions in bpo-40137 that I just created: TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@corona10 corona10 mentioned this pull request Jun 27, 2022
Convert static types to heap types: use PyType_FromSpec() #84258
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner Awaiting requested review from vstinner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@corona10 @vstinner @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.