| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
* w.wm_attributes() without arguments returns a dict instead of a tuple or a str. * When called with a single argument to get a value, it allow to omit the minus prefix. * It can be called with keyword arguments to set attributes.
|
To me, the changes are all good and at least a decade overdue. For instance, it upgrades w.wm_attributes to work like w.config. This issue comment gives more details. The sticky part is immediately changing the return object of a no-arg call. This should be a plus for interactive uses and for new programmatic uses. However, it will break existing code that probes the structure of the return object. The default requirement of PEP 387 is a deprecation period. The alternative (the last sentence): "If a warning cannot be provided to users, consult with the steering council." In this case, () cannot both give the old return with a warning and give the new return. So giving a warning would mean either not returning a dict until 3.15 (not nice) or temporarily requiring some temporary signal to get a dict. If None were intended to be used indefinitely to get the old return, the signal would have to be something else, like passing the dict class. (Yes, a bit ugly.) I believe there is precedent to making an immediate change when the alternative is seen as worse. Part of the trade-off in such a decision would be knowing how common programmatic uses there are (and better, about how many of those would be broken). (There are core devs who have scripts to do such searches.) "Consulting with the security council" should begin with a post to the Python Core Dev discord. (edit: sorry for the mis-click) |
Sorry, something went wrong.
|
@gpshead, I implemented your suggestion. Do you mind to review it? @terryjreedy, please make yet one look at it. |
Sorry, something went wrong.
|
Sorry I did not get back to this. Looks like the best we could do under the costraints. |
Sorry, something went wrong.
There was a problem hiding this comment.
thanks for doing this!
Sorry, something went wrong.
…H-111404) * When called with a single argument to get a value, it allow to omit the minus prefix. * It can be called with keyword arguments to set attributes. * w.wm_attributes(return_python_dict=True) returns a dict instead of a tuple (it will be the default in future). * Setting wantobjects to 0 no longer affects the result.
| Back | FazBrowse Home | New Git URL |
📚 Documentation preview 📚: https://cpython-previews--111404.org.readthedocs.build/