Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.]

2013-06-17 Thread Marcin Szamotulski
> While you said to me to forget about memory locations, and that's indeed > made things easy to follow i still keep wondering, how Python internally > keeping tracks of 'x' and 'y' names as well as their referenced objects > (i.e. number 6). There is an excellent blog post about CPython intern

Re: Why is the argparse module so inflexible?

2013-06-29 Thread Marcin Szamotulski
On 05:28 Sat 29 Jun , Steven D'Aprano wrote: > On Fri, 28 Jun 2013 18:36:37 -0700, Ethan Furman wrote: > > > On 06/27/2013 03:49 PM, Steven D'Aprano wrote: > >> > >> [rant] > >> I think it is lousy design for a framework like argparse to raise a > >> custom ArgumentError in one part of the cod

Re: Stupid ways to spell simple code

2013-07-01 Thread Marcin Szamotulski
On 17:30 Mon 01 Jul , Joshua Landau wrote: > On 1 July 2013 14:14, Chris Angelico wrote: > > On Mon, Jul 1, 2013 at 10:59 PM, Neil Cerutti wrote: > >> On 2013-06-30, Chris Angelico wrote: > >>> So, here's a challenge: Come up with something really simple, > >>> and write an insanely complica

Re: Stupid ways to spell simple code

2013-07-01 Thread Marcin Szamotulski
On 22:09 Mon 01 Jul , Steven D'Aprano wrote: > On Mon, 01 Jul 2013 20:36:29 +0100, Marcin Szamotulski wrote: > > > Here is another example which I came across when playing with > > generators, the first function is actually quite useful, the second > &g

Re: Class construction

2013-10-21 Thread Marcin Szamotulski
You can inspect the process in this way: >>> c = 'class A: pass' >>> code = compile(c, '', 'exec') >>> from dis import dis >>> dis(code) 1 0 LOAD_BUILD_CLASS 1 LOAD_CONST 0 (", line 1>) 4 LOAD_CONST 1 ('A') 7 MAKE_FUN