Skip to content
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

getsource not get correct source code #703

Open
Seraphli opened this issue Feb 27, 2025 · 1 comment · May be fixed by #704
Open

getsource not get correct source code #703

Seraphli opened this issue Feb 27, 2025 · 1 comment · May be fixed by #704

Comments

@Seraphli
Copy link

import dill


class A:
    def a(self):
        print("a")


print(dill.source.getsource(A))


class A:
    def b(self):
        print("b")


print(dill.source.getsource(A))

Which will return

class A:
    def b(self):
        print("b")

class A:
    def b(self):
        print("b")
@Seraphli Seraphli linked a pull request Feb 27, 2025 that will close this issue
5 tasks
@Seraphli
Copy link
Author

I create a PR #704 for fixing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant