-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCS/lua: note that properties are preferred to getcwd and getpid #13226
Conversation
I know this is not yet gone, but it will be when the next round of blind deprecated functionality removal happens. I'm sure someone thinks "please stop depending on deprecated features", but at least one PR #9541 has broken functionality in trackselect and I don't believe there is a way to reproduce the same behavior (detecting when a track is explicitly switched to by the user) by observing the |
These will probably never be removed as there is no maintenance cost. The purpose of the deprecation is to avoid confusion. There are about |
That removed 700 lines of code, it is not comparable to 1-line wrappers which cause no maintenance burden. |
If this is what you think then don't deprecate. Deprecating means exactly one thing: it will get removed so users shouldn't depend on it. This is hurting users for no good reason. Instead, just document better that it's identical to the properties. It costs us nothing to maintain these trivial wrappers, and it helps users which don't need to keep changing their scripts. |
e76b649
to
e6e4a79
Compare
I don't understand what these have to do with getcwd and getpid, and I have no power to decide what mpv maintainers will remove either way.
Per Wikipedia's definition https://en.wikipedia.org/wiki/Deprecation deprecation can mean that a feature is obsolete without removing it, as is the case with 40+ things listed in mpv's manual.
No user is hurt because nobody wants to remove these functions. I added a note that the functions will keep working regardless, but why only these 2 functions needed this note out of 40+ deprectaed things is unclear. |
TBH I don't see any reason to "deprecate" them either. Just document it being identical to the property if you think it causes confusion. |
e6e4a79
to
a3b6af1
Compare
a3b6af1
to
afa61c4
Compare
DOCS/man/lua.rst
Outdated
is returned. | ||
is returned. This is equivalent to retrieving the ``working-directory`` | ||
property, which is preferred because it is available to clients other than | ||
scripts. |
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.
okay but this is not actually an argument.
If you are reading these docs you are in a Lua script. Whether other clients can retrieve the same stuff is irrelevant to you. You just want it from Lua.
Explain that these functions are equivalent to the respective properties to prevent confusion like in mpv-player#7975 (comment)
In general exposing stuff via properties and not Lua-specific functions makes sense (so IPC clients are as powerful as scripts), but for these two I think it doesn't make sense to recommend properties. What you want: the PID there is no reason to have all this complexity. tl;dr I vote to just close this PR |
afa61c4
to
aeb0a0d
Compare
This prevents script writers from getting confused over whether to use these functions or the properties, like in
#7975 (comment)
They are moved to the end of the list of utils functions because having the first one in the list be a deprecated one would be weird.