Re: Obfuscated factorial

2013-10-27 Thread Vito De Tullio
Joshua Landau wrote: > Python already supports the factorial operator, -ⵘ. why use ⵘ (TIFINAGH LETTER AYER YAGH) when you can have the BANG? 방 (HANGUL SYLLABLE BANG) > You just have to > import it. > > # Import statement > ⵘ = type("",(),{"__rsub__":lambda s,n:(lambda f,n:f(f,n))(lambda > f,z

Re: Obfuscated factorial

2013-10-26 Thread Gene Heskett
On Saturday 26 October 2013 10:12:33 Steven D'Aprano did opine: > Just for fun: > > > class Numberator: > def __init__(self, number): > self.__number = number > def evaluate(self): > return self.__number > > class Multiplier: > def __init__(self, multiplier, multipli

Re: Obfuscated factorial

2013-10-26 Thread Tim Chase
On 2013-10-27 00:26, Chris Angelico wrote: > On Sat, Oct 26, 2013 at 11:50 PM, Vito De Tullio > wrote: > > you miss a FactoryFactory and a couple of *Manager. > > > > Oh, and it should be xml-config-driven. > > Or a metaclass and a few decorators. They're inherently Pythonic, > right? You are de

Re: Obfuscated factorial

2013-10-26 Thread Joshua Landau
On 26 October 2013 12:55, Steven D'Aprano wrote: > Just for fun: ... > for i in range(16): > print(i, FactorialBuilder(i).build().calculate()) Python already supports the factorial operator, -ⵘ. You just have to import it. # Import statement ⵘ = type("",(),{"__rsub__":lambda s,n:(lambda f,n:

Re: Obfuscated factorial

2013-10-26 Thread Chris Angelico
On Sat, Oct 26, 2013 at 11:50 PM, Vito De Tullio wrote: > you miss a FactoryFactory and a couple of *Manager. > > Oh, and it should be xml-config-driven. Or a metaclass and a few decorators. They're inherently Pythonic, right? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Obfuscated factorial

2013-10-26 Thread Vito De Tullio
Steven D'Aprano wrote: > Just for fun: [...] you miss a FactoryFactory and a couple of *Manager. Oh, and it should be xml-config-driven. -- By ZeD -- https://mail.python.org/mailman/listinfo/python-list