Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18729

Re: function problem

References <CA+YdQ_6dCAQDkrgbAVaTFhWb-Q1PJwPzgLwq69TT90NE8QoVYg@mail.gmail.com>
Date 2012-01-09 19:44 -0800
Subject Re: function problem
From Chris Rebert <clp2@rebertia.com>
Newsgroups comp.lang.python
Message-ID <mailman.4573.1326167074.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Jan 9, 2012 at 7:35 PM, contro opinion <contropinion@gmail.com> wrote:
> code1:
>
> def FirstDeco(func):
>    print 'haha'
>    y=func()
>    return y
>    print  y

Since there's a `return` right before it, the latter `print` here will
*never* be executed.

Cheers,
Chris

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: function problem Chris Rebert <clp2@rebertia.com> - 2012-01-09 19:44 -0800

csiph-web