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-43988: Add test.support.check_disallow_instantiation by erlend-aasland · Pull Request #25757 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Apr 30, 2021 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

https://bugs.python.org/issue43988

Sorry, something went wrong.

Uh oh!

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

All reactions
Erlend E. Aasland
bpo-43988: Add test.support.check_disallow_instantiation
a1f8454
@bedevere-bot bedevere-bot added the awaiting review label Apr 30, 2021
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Apr 30, 2021
@erlend-aasland

erlend-aasland commented Apr 30, 2021

Copy link
Copy Markdown
Contributor Author

cc. @vstinner

All reactions

Sorry, something went wrong.

Uh oh!

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

vstinner
vstinner reviewed Apr 30, 2021
View reviewed changes
Comment thread Lib/test/support/__init__.py

See bpo-43916.
"""
msg = f"cannot create '{tp.__module__}\.{tp.__name__}' instances"

@vstinner vstinner Apr 30, 2021

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.

You should use f"xxx\.xxx" or fr"xxx.xxx". Or maybe use re.escape().

Sorry, something went wrong.

Uh oh!

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

All reactions

@erlend-aasland erlend-aasland May 2, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor 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.

Since these tests are decorated with cpython_only, it should be ok to match the exact string, as produced by Objects/typeobject.c? Just matching the type module/name could in theory generate wrong result; maybe not in practice though.

Sorry, something went wrong.

Uh oh!

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

All reactions

@erlend-aasland erlend-aasland May 2, 2021

Copy link
Copy Markdown
Contributor 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.

What about setting the match pattern depending on what test.support.check_impl_detail() says?

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/test/support/__init__.py Resolved

Uh oh!

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

vstinner
vstinner reviewed Apr 30, 2021
View reviewed changes
Comment thread Lib/test/support/__init__.py Resolved

Uh oh!

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

vstinner
vstinner reviewed Apr 30, 2021
View reviewed changes
Comment thread Lib/test/support/__init__.py Resolved

Uh oh!

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

@vstinner vstinner added the skip news label May 26, 2021
@vstinner
vstinner merged commit 4f72526 into python:main May 26, 2021
@bedevere-bot bedevere-bot removed the awaiting review label May 26, 2021
@vstinner

vstinner commented May 26, 2021

Copy link
Copy Markdown
Member

Enough nitpicking, you can always enhance the code later ;-) I merged your PR, thanks. I guess that the next step is to modify existing tests to use it.

erlend-aasland reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland
erlend-aasland deleted the test-support branch May 26, 2021 14:40
@erlend-aasland erlend-aasland mentioned this pull request May 26, 2021
bpo-42972: Fully support GC for _winapi.Overlapped #26381
Merged
@erlend-aasland

erlend-aasland commented May 26, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

Backport to 3.10? I guess not.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented May 26, 2021

Copy link
Copy Markdown
Member

Backport to 3.10? I guess not.

It seems like more changes are coming. Once they all landed into main, maybe write a backport to 3.10 PR including all of them at once (git cherry-pick -x all commits in the right order). Or we can leave 3.10 as it is: it's more up to you.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented May 26, 2021

Copy link
Copy Markdown
Contributor Author

Lets leave 3.10 as it is.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland erlend-aasland mentioned this pull request Jun 20, 2021
[3.10] bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567) #26813
Closed
@erlend-aasland

erlend-aasland commented Jun 20, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

@pablogsal, should we backport this? grep -r disallow_insta Lib/test | wc -l gives me 14 hits on the 3.10 branch, including the recently backported sqlite3 test.

All reactions

Sorry, something went wrong.

Uh oh!

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

@pablogsal

pablogsal commented Jun 20, 2021

Copy link
Copy Markdown
Member

@pablogsal, should we backport this? grep -r disallow_insta Lib/test | wc -l gives me 14 hits on the 3.10 branch, including the recently backported sqlite3 test.

I would prefer to backport it, yep

erlend-aasland 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.

erlend-aasland pushed a commit to erlend-aasland/cpython that referenced this pull request Jun 23, 2021
Erlend Egeberg Aasland
[3.10] bpo-43988: Add test.support.check_disallow_instantiation() (py…
9122e87
…thonGH-25757).

(cherry picked from commit 4f72526)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
@erlend-aasland

erlend-aasland commented Jun 23, 2021

Copy link
Copy Markdown
Contributor Author

Once they all landed into main, maybe write a backport to 3.10 PR including all of them at once (git cherry-pick -x all commits in the right order)

@vstinner: I've opened GH-26885 which is a backport of this PR, GH-26394 (docs for this PR), and GH-26392 (apply this PR to Lib/test).

All reactions

Sorry, something went wrong.

Uh oh!

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

miss-islington pushed a commit that referenced this pull request Jun 23, 2021
Erlend Egeberg Aasland
[3.10] bpo-43988: Add test.support.check_disallow_instantiation() (GH…
0a3452e
…-25757) (GH-26885)

(cherry picked from commit 4f72526, fbff538, and 8cec740)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>

Automerge-Triggered-By: GH:vstinner
@pablogsal pablogsal mentioned this pull request Jul 18, 2021
[3.10] Correct the order of regen-abidump #27228
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner left review comments

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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.

5 participants

@erlend-aasland @vstinner @pablogsal @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.