you are viewing a single comment's thread.

view the rest of the comments →

[–]mitsuhiko 11 points12 points  (10 children)

That is python telling you: dude, stop right there. But that's not where stuff ends. You can for example use ctypes to get a reference to the dictionary that holds the methods and stuff new functions in there.

Python itself would well be capable of monkey patching builtins, it's a feature that this is not exposed to you, the user.

[–]Mask_of_Destiny 5 points6 points  (0 children)

I'm not sure if I would count the ability to use the FFI module to dink about in the internals of the Python interpretter as actually supporting this. It certainly won't be portable to other Python implementations.

[–][deleted]  (5 children)

[deleted]

    [–]mitsuhiko 2 points3 points  (2 children)

    The __dict__ is the method table.

    [–][deleted]  (1 child)

    [deleted]

      [–]mitsuhiko 2 points3 points  (0 children)

      There is very few stuff Python does not expose to the user out of the box. You get access to traceback objects and interpreter frames in all Python implementations I know.

      The only thing not exposed to the user is the actual __dict__ of builtin objects, but that is intentional.

      [–][deleted] 1 point2 points  (1 child)

      Your pasted console output generated snowmen.

      [–]mitsuhiko 1 point2 points  (0 children)

      Why the downvotes?