GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • [Python-Dev] type(obj) vs. obj.__class__
  • [Python-Dev] type(obj) vs. obj.__class__
  • [ date ]
  • [ thread ]
  • [ subject ]
  • [ author ]

This view

  • Original page
  • New address

GeezerVison is showing mail.python.org — [Python-Dev] type(obj) vs. obj.__class__

[Python-Dev] type(obj) vs. obj.__class__

Guido van Rossum guido at python.org
Sun Oct 18 23:10:07 EDT 2015

  • Previous message (by thread): [Python-Dev] type(obj) vs. obj.__class__
  • Next message (by thread): [Python-Dev] type(obj) vs. obj.__class__
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

Assigning __class__ is a precarious stunt (look at the implementation, it
requires lots of checks for various things like __slots__ and
implementation-specific special cases). The gesture that looks like
"overriding a method" is merely setting a new instance attribute that hides
the method, and quite tame in comparison.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20151018/1705608f/attachment.html>

  • Previous message (by thread): [Python-Dev] type(obj) vs. obj.__class__
  • Next message (by thread): [Python-Dev] type(obj) vs. obj.__class__
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

More information about the Python-Dev mailing list
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.