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 — Make `os.path.join()` first parameter pos-only by AlexWaygood · Pull Request #6812 · python/typeshed

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Jan 4, 2022

Copy link
Copy Markdown
Member

I was recently surprised to find that the mypy test suite doesn't pass mypy when run on Windows. This is because posixpath.join() and ntpath.join() have different names for the first parameter.

Given that both posixpath and ntpath are undocumented modules -- which only exist to provide platform-specific implementations for the os.path module -- I think it makes sense to make the first parameter positional-only for both functions. The whole point of the os.path module is that you can get path-related functions that will reliably work on all systems. That guarantee goes away if you use a keyword argument for the first parameter of os.path.join().

Sorry, something went wrong.

Uh oh!

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

All reactions
AlexWaygood and others added 4 commits January 4, 2022 10:53
@AlexWaygood
Update posixpath.pyi
da10e94
@AlexWaygood
Update ntpath.pyi
7052760
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
72e8e5e
@AlexWaygood
Update py310.txt
4237479
@AlexWaygood
AlexWaygood marked this pull request as ready for review January 4, 2022 11:07
@github-actions

This comment has been minimized.

Sign in to view
@AlexWaygood AlexWaygood mentioned this pull request Jan 4, 2022
Make mypy test suite pass mypy type-check on Windows python/mypy#11895
Closed
@github-actions

github-actions Bot commented Jan 4, 2022

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

AlexWaygood reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

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

srittau
srittau approved these changes Jan 4, 2022
View reviewed changes

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

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.

Sounds like a good idea.

Sorry, something went wrong.

Uh oh!

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

AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@srittau
srittau merged commit 582f1e9 into python:master Jan 4, 2022
@AlexWaygood
AlexWaygood deleted the os-path branch January 4, 2022 14:39
AlexWaygood added a commit to AlexWaygood/mypy that referenced this pull request Jan 5, 2022
@AlexWaygood
Run self-check on Windows as part of CI
88c7d31
As discussed in python#11895, mypy's test suite currently does not pass a mypy self-check when run on Windows. This should hopefully be fixed by python/typeshed#6812, but running a self-check on Windows as part of the CI tests should help avoid this issue in the future.

This new CI test should hopefully fail until python#11905 is merged, confirming the diagnosis of the problem that I made in python#11895. Once python#11905 is merged, it should hopefully then pass, allowing this PR to be merged.
@AlexWaygood AlexWaygood mentioned this pull request Jan 5, 2022
Run self-check on Windows as part of CI python/mypy#11909
Merged
JelleZijlstra pushed a commit to python/mypy that referenced this pull request Jan 28, 2022
@AlexWaygood
Run self-check on Windows as part of CI (#11909)
8f9ebf0
As discussed in #11895, mypy's test suite currently does not pass a mypy self-check when run on Windows. This should hopefully be fixed by python/typeshed#6812, but running a self-check on Windows as part of the CI tests should help avoid this issue in the future.
@AlexWaygood AlexWaygood mentioned this pull request Sep 23, 2023
Update os.path.isdir on Windows Python3.12+ #10751
Closed
@aminalaee aminalaee mentioned this pull request Sep 24, 2023
Make syslog setlogmask, LOG_MASK and LOG_UPTO positional-only #10756
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@srittau srittau srittau approved these changes

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.

2 participants

@AlexWaygood @srittau
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.