1
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Justin Searls

@stevenharman I've been using this pattern since releasing gimme in 2011 and it's always worked in practice. Since the callsite of of_next and the next callsite of .new is almost always one stack frame apart, there's almost nothing that can go wrong

(Also, Mocktail goes to pretty extreme lengths to make mocks of class methods like `new` thread-safe, which is sorta bonkers)

1
1y
Replies