Last active
February 17, 2017 19:48
-
-
Save blaix/414593c8ad08e33022e34911fc5b1df3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass: | |
def __init__(one, two, three): | |
self.one = one | |
self.two = two | |
self.three = three | |
@classmethod | |
def my_factory_method(one, two, three=None): | |
if three is None: | |
return MyClassWithoutThree(one, two) | |
return MyClass(one, two, three) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// option 1 | |
var ParentView = AmpersandView.extend({ | |
createSubViews: function(opts, views) { | |
var context = {}; | |
this.wwwToggleView = views.get('wwwToggleView', context); | |
} | |
}); | |
// option 2 | |
var ParentView = AmpersandView.extend({ | |
createSubViews: function(opts) { | |
var context = {}; | |
this.wwwToggleView = WWWToggleView.for(context); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment