Skip to content

getsource not get correct source code #703

Open

Description

@Seraphli
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")

Activity

  1. Seraphli commented on Feb 27, 2025

    @Seraphli
    Author

    I create a PR #704 for fixing this issue.

  2. added this to the dill-0.4.2 milestone on Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions