Skip to content

Update about_new_style_classes.py#148

Merged
mpirnat merged 1 commit into
gregmalcolm:masterfrom
xgongluo:patch-2
Dec 5, 2016
Merged

Update about_new_style_classes.py#148
mpirnat merged 1 commit into
gregmalcolm:masterfrom
xgongluo:patch-2

Conversation

@xgongluo
Copy link
Copy Markdown
Contributor

@xgongluo xgongluo commented Nov 1, 2016

change class to class.name in line 49

change __class__ to __class__.__name__ in line 49
@mpirnat
Copy link
Copy Markdown
Collaborator

mpirnat commented Dec 5, 2016

It looks like the intention here was to demonstrate that with the advent of new-style classes, types and classes were unified (see https://www.python.org/download/releases/2.2.3/descrintro/).

The passing test case that shows this would be:

self.assertEqual(type(self.NewStyleClass), self.NewStyleClass.__class__)

It's probably a good idea to add a comment here to make this clearer. I'll give it a try and see if I can word it decently without giving it all away.

@mpirnat mpirnat closed this Dec 5, 2016
@mpirnat mpirnat reopened this Dec 5, 2016
@mpirnat
Copy link
Copy Markdown
Collaborator

mpirnat commented Dec 5, 2016

Actually I have a problem with my brain being missing. Sorry! Reopening and merging this.

@mpirnat mpirnat merged commit 23ade00 into gregmalcolm:master Dec 5, 2016
@xgongluo xgongluo deleted the patch-2 branch December 5, 2016 03:25
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 this pull request may close these issues.

2 participants