Skip to content

Remove deprecated code.co_lnotab #119664

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

Closed
picnixz opened this issue May 28, 2024 · 5 comments
Closed

Remove deprecated code.co_lnotab #119664

picnixz opened this issue May 28, 2024 · 5 comments
Labels
type-feature A feature request or enhancement

Comments

@picnixz
Copy link
Member

picnixz commented May 28, 2024

Feature or enhancement

Proposal:

This is an issue to track the removal of code.co_lnotab deprecated since 3.12 and scheduled for removal in 3.14.

In #101865, it is marked "may be removed" but I think it should be removed. If not, we should harmonize the docs which sometimes state "will be removed" and sometimes say "may be removed" (also the corresponding tests are marked as "todo: remove in 3.14").

Has this already been discussed elsewhere?

No, so we can discuss here whether we should remove it now or not.

Links to previous discussion of this feature:

#101865

Linked PRs

@picnixz picnixz added the type-feature A feature request or enhancement label May 28, 2024
@picnixz picnixz changed the title [3.14] remove code.co_lnotab [3.14] remove deprecated code.co_lnotab May 28, 2024
@hugovk hugovk changed the title [3.14] remove deprecated code.co_lnotab Remove deprecated code.co_lnotab May 28, 2024
@hugovk hugovk added the 3.14 bugs and security fixes label May 28, 2024
@iritkatriel
Copy link
Member

In #101865, it is marked "may be removed" but I think it should be removed.

What is the reason for removing it?

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

For someone who uses it and will be required to change their code this is not minor. We don't always remove things just because we can, if they are not getting in anyone's way. I think this decision needs to be discussed.

@picnixz
Copy link
Member Author

picnixz commented May 29, 2024

Oh it was actually scheduled for removal in Python 3.14 (deprecated in 3.12). Actually, it was scheduled for removal for 3.12 but since no DeprecationWarning was set in 3.10, it got delayed (see https://peps.python.org/pep-0626/#backwards-compatibility).

EDIT 1: Also, in 3.10 and 3.12 it was said "will be removed" but for 3.13 it was marked "may be removed". Feel free to close the related PR if a discussion is needed (or maybe I should open one on discourse?).

EDIT 2: If I were to motivate the reason, there are two points to adress:

  • This is marked as pending removal for 3.14 in the What's New pages. As such, it gives me the feeling that this is scheduled for removal. While I agree that there are places when it is not sure whether it would be removed, the stable version tells you that it will.

  • The second reason is that none of the current code is using that attribute anymore and maintaining it required additional conversion functions. It would simplify a bit the codeobject.c file.

Now, if you think that someone is using it and we would break it, I think they should likely update their code and use the new co_lines() method because it was designed to be more practical. Again, this is my personal opinion on the topic and I am not an expert. Nonetheless, if you decide to keep it, I think we should at least harmonize the docs.

@markshannon
Copy link
Member

I don't see any need to remove this just yet.

We will probably need to remove it at some point, in order to change the internal format of the position table, but we might as well leave until then.

@picnixz
Copy link
Member Author

picnixz commented Jun 19, 2024

Then would you consider the rewording of the removal notice as presented in #120263? (so that we don't have confusion in the future)

@picnixz
Copy link
Member Author

picnixz commented Aug 28, 2024

(Closing as wontfix since I actually closed the PRs. We'll reopen once we need to actually remove it I think, or just create another issue)

@picnixz picnixz closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2024
@picnixz picnixz removed the 3.14 bugs and security fixes label Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants