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)
- " , " Grammatical confusion! ----- , 语法的迷惑 ! HOT 5
- sysconfig values for `platstdlib` do not appear to be accurate
- [C API] Add a public Py_nullptr macro (rename private _Py_NULL) HOT 5
- [C API] Split large object.h file: create refcount.h HOT 1
- pyrepl help (pydoc): "exit" does not exit, whereas "quit" does HOT 1
- Spill the stack pointer across calls in the interpreter. HOT 2
- Utilize last character gap for two-way periodic needles
- During decompression python tries to read sys.maxsize - which fail on start with MemoryError in case of any resource memory limit set.
- Wrong `follow_symlinks` default fallback implementation HOT 5
- Error exiting the new REPL with Ctrl+Z on Windows HOT 3
- [3.12] Lambda generators cause assertion failure: `python: Objects/genobject.c:400: gen_close: Assertion `exception_handler_depth > 0' failed.` HOT 3
- Improve ``NameError`` message when non-mangled name exists in the global scope HOT 9
- Flaky test `test_asyncio_repl_is_ok` in `test_repl` HOT 7
- Python 3.11 and above adding default module search path from the “PythonPath” registry key if the standard library was found already HOT 4
- Type parameters: Incorrect text in SyntaxError for disallowed expression HOT 8
- Multiple bugs in `multiprocessing.managers`: pickling, nesting, etc
- Cannot define Enum class with a mixin class derived from ABC HOT 14
- test_exc() helper in test_format.py doesn't fail if exception message unexpected HOT 6
- Count the number of weekends between 2 dates HOT 9
- Dynamic string search algorithm selection HOT 1
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.