Comments (2)
cc @rhettinger
from cpython.
This would be nice improvement. Do you want to submit a PR or have me do it?
We want to match the dict.fromkeys()
signature including the slash for positional only.
>>> help(dict.fromkeys)
Help on built-in function fromkeys:
fromkeys(iterable, value=None, /) method of builtins.type instance
Create a new dictionary with keys from iterable and values set to value
Also, let's only do this for Python 3.13. The previous code isn't buggy so no backport is warranted.
Side note: The reason that the code looks like this is that it predates the /
positional-only marker. There was no other way to emulates dict.fromkeys()
which did not accept keyword arguments.
from cpython.
Related Issues (20)
- Use "import a.b" but a.b may not be what I want, even not a module HOT 3
- isinstance(list[anything], type) returns False since Python 3.11 HOT 1
- codecs.Stream{Reader,Writer} close parent stream on __exit__ HOT 4
- Make `cell` thread-safe in the free-threaded build
- The codecs module mostly but not fully supports non str<->bytes codecs
- re.Match.__getitem__ may support tuples and slices HOT 1
- Handle non-iterables for `ntpath.commonpath` HOT 4
- Deprecate glob.glob0() and glob.glob1() HOT 1
- Handle leading `//` for `posixpath.realpath` HOT 10
- dis [docs]: LOAD_SUPER_ATTR should push NULL instead of None if the lowest bit is set HOT 2
- Worker management race conditions in `ThreadPoolExecutor` and `ProcessPoolExecutor`
- `test_clinic` fails with the `--forever` argument HOT 9
- configparser.RawConfigParser._read is unmanageably complex HOT 1
- Speed up `os.path` HOT 4
- Handle `/:/` for `ntpath.isabs` HOT 15
- Callable.collections HOT 2
- Download link for Python 3.5.9 is broken and returns a 404 HOT 8
- Confusing wording in `os.path.lexists` docs HOT 6
- Improve `os` HOT 1
- Consider adding `doctest.skip_if` decorator HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpython.