On Feb 12, 2014 9:16 PM, "Steven D'Aprano" wrote:
>
> On Tue, 11 Feb 2014 07:36:34 -0800, Travis Griggs wrote:
>
> > On Feb 10, 2014, at 10:30 PM, Steven D'Aprano
> > wrote:
> >
> >
> >>>1. Parenthesis should not be required for parameter- less
> >>>functions.
> >>
> >> Of course they sho
On Fri, Feb 14, 2014 at 1:58 AM, Roy Smith wrote:
> In article ,
> Chris Angelico wrote:
>
>> Whether it's a module-level function, a bound method, a closure, or a
>> callable object, a zero-arg function in Python always has some kind of
>> implicit state.
>
> Sometimes, it has a *lot* of implic
In article ,
Chris Angelico wrote:
> Whether it's a module-level function, a bound method, a closure, or a
> callable object, a zero-arg function in Python always has some kind of
> implicit state.
Sometimes, it has a *lot* of implicit state:
os.fork()
--
https://mail.python.org/mailman/listi
On 2014-02-13 05:39, Tim Chase wrote:
> def age(self, as_of=None):
> if as_of is None:
> as_of = datetime.date.today()
> return as_of = self.dob
and of course I mean
return as_of - self.dob
which is what I get for typing in the dark and the "-" and "="
keys are adjacent. :-/
-
On 2014-02-13 04:11, Steven D'Aprano wrote:
> give_me_an_even_number()
> => returns 42
> give_me_an_even_number()
> => returns 23
>
> Hmmm. There's a bug in give_me_an_even_number(). How do I reproduce
> that bug? What arguments do I pass? Oh, the same no-arguments as
> for the working call.
>
>
On Thu, Feb 13, 2014 at 3:11 PM, Steven D'Aprano wrote:
> Think about the difference in difficulty in confirming that
> math.sin() of some value x returns the value 0.5, and confirming that
> random.random() of some hidden state returns a specific value:
>
> py> assert math.sin(0.5235987755982989)
On Tue, 11 Feb 2014 07:36:34 -0800, Travis Griggs wrote:
> On Feb 10, 2014, at 10:30 PM, Steven D'Aprano
> wrote:
>
>
>>>1. Parenthesis should not be required for parameter- less
>>>functions.
>>
>> Of course they should. Firstly, parameter-less functions are a code-
>> smell, and ough
On 2/11/2014 11:19 AM, Travis Griggs wrote:
On Feb 11, 2014, at 7:52 AM, Chris Angelico wrote:
So in that situation, the no-args call does make sense. Of course,
this is a call to a function that does take args, but it's accepting
all the defaults and providing no additional content. It's qui
On Feb 11, 2014, at 7:52 AM, Chris Angelico wrote:
> On Wed, Feb 12, 2014 at 2:36 AM, Travis Griggs wrote:
>> OTOH, I’m not sure I’ve heard the parameters-less functions are a code one?
>> Is it just loose functions that you’re referring to? As opposed to methods
>> (which are just bound func
On Wed, Feb 12, 2014 at 3:07 AM, Jussi Piitulainen
wrote:
> Travis Griggs writes:
>
>> in fact, methods with long parameter lists are generally seen as
>
> "If you have a predicate with ten arguments, you probably forgot some"
> (heard long time ago over in the Prolog world).
Conversely:
"Thirte
Travis Griggs writes:
> in fact, methods with long parameter lists are generally seen as
"If you have a predicate with ten arguments, you probably forgot some"
(heard long time ago over in the Prolog world).
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Feb 12, 2014 at 2:36 AM, Travis Griggs wrote:
> OTOH, I’m not sure I’ve heard the parameters-less functions are a code one?
> Is it just loose functions that you’re referring to? As opposed to methods
> (which are just bound functions)? I could maybe accept that. But methods with
> fewe
On Feb 10, 2014, at 10:30 PM, Steven D'Aprano wrote:
>>
>>1. Parenthesis should not be required for parameter- less functions.
>
> Of course they should. Firstly, parameter-less functions are a code-
> smell, and ought to be discouraged. Secondly, even if you have a good
> reason for usin
On 2014-02-11 06:30, Steven D'Aprano wrote:
> You need to understand the difference between syntax and semantics.
> This is invalid English syntax:
>
> "Cat mat on sat the."
>
> This is valid syntax, but semantically wrong:
>
> "The mat sat on the cat."
>
> This is both syntactically and semant
On Mon, 10 Feb 2014 10:45:40 -0800, Rick Johnson wrote:
> ## START CODE ###
> def foo():
> # foo represents a patternless function
Patternless? I have never heard that term before in this context. Do you
mean a parameter-less or argument-less functio
On 2/10/2014 4:12 PM, Rotwang wrote:
On 10/02/2014 18:45, Rick Johnson wrote:
[...]
3. Implicit introspection is evil, i prefer all
references to a callable's names to result in a CALL
to that callable, not an introspection!
So, for example, none of
isinstance(x, myclass)
On Tue, Feb 11, 2014 at 5:45 AM, Rick Johnson
wrote:
> if foo: # <- forgot parenthesis!
> print 'implicit conversion to bool bites!'
You also forgot the parentheses on the second line, and that's nothing
to do with boolification :)
ChrisA
--
https://mail.python.org/mailman/listinfo/python-l
On 2/10/14 4:12 PM, Rotwang wrote:
On 10/02/2014 18:45, Rick Johnson wrote:
[...]
3. Implicit introspection is evil, i prefer all
references to a callable's names to result in a CALL
to that callable, not an introspection!
So, for example, none of
isinstance(x, myclass)
On 10/02/2014 18:45, Rick Johnson wrote:
[...]
3. Implicit introspection is evil, i prefer all
references to a callable's names to result in a CALL
to that callable, not an introspection!
So, for example, none of
isinstance(x, myclass)
map(myfunc, range(10))
x = p
On 2/10/14 1:45 PM, Rick Johnson wrote:
## START CODE ###
def foo():
# foo represents a patternless function
# or method that returns a Boolean value
# based on some internal test.
#
if 1==1:
return True
return False
#
On 10/02/2014 18:45, Rick Johnson wrote:
## START CODE ###
def foo():
# foo represents a patternless function
# or method that returns a Boolean value
# based on some internal test.
#
if 1==1:
return True
return False
## START CODE ###
def foo():
# foo represents a patternless function
# or method that returns a Boolean value
# based on some internal test.
#
if 1==1:
return True
return False
#
# The fun begins when two tiny chars are forgott
22 matches
Mail list logo