> On 31 May 2021, at 18:24, Peter Otten <__pete...@web.de> wrote:
>
> On 31/05/2021 17:57, Colin McPhail via Python-list wrote:
>> Hi,
>> According to the enum module's documentation an Enum-based enumeration's
>> members can have values of any type:
>> "Member values can be anything: int
On 31/05/2021 17:57, Colin McPhail via Python-list wrote:
Hi,
According to the enum module's documentation an Enum-based enumeration's
members can have values of any type:
"Member values can be anything: int, str, etc.."
You didn't read the fineprint ;)
"""
The rules for what is all
On Mon, Jul 23, 2018 at 1:49 AM, MRAB wrote:
> On 2018-07-22 10:08, Ben Finney wrote:
>>
>> INADA Naoki writes:
>>
>>> Please don't refer the FAQ entry.
>>> See this: https://bugs.python.org/issue27671
>>
>>
>> Interesting. Thanks for raising that bug report.
>>
>> I offer my text as a starting p
On 2018-07-22 10:08, Ben Finney wrote:
INADA Naoki writes:
Please don't refer the FAQ entry.
See this: https://bugs.python.org/issue27671
Interesting. Thanks for raising that bug report.
I offer my text as a starting point for a better explanation:
Because ‘len’ works with *any* seque
INADA Naoki writes:
> Please don't refer the FAQ entry.
> See this: https://bugs.python.org/issue27671
Interesting. Thanks for raising that bug report.
I offer my text as a starting point for a better explanation:
Because ‘len’ works with *any* sequence, not only lists. To
implement it
>
> Your particular question is itself a FAQ
> https://docs.python.org/3/faq/design.html#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list>.
>
Please don't refer the FAQ entry.
See this: https://bugs.python.org/issue27671
--
INADA Naoki
--
On Sunday, 22 July 2018 13:32:16 UTC+5:30, Ben Finney wrote:
> Sharan Basappa writes:
>
> > Is there a difference between functions and methods in Python.
>
> Python's documentation includes a useful Glossary. See the terms
> https://docs.python.org/3/glossary.html#term-method>
> https://docs.p
Sharan Basappa writes:
> Is there a difference between functions and methods in Python.
Python's documentation includes a useful Glossary. See the terms
https://docs.python.org/3/glossary.html#term-method>
https://docs.python.org/3/glossary.html#term-function>.
Every method is a function; but t
Sharan Basappa writes:
> Is there a difference between functions and methods in Python.
Somewhat simplified: a method is a function with the
method's associated object implicitly passed as first argument.
For a Python defined method "m", you can get the corresponding
function via "m.__func__" (
Thanks a lot.
On Sunday, 22 July 2018 04:02:23 UTC+5:30, Rick Johnson wrote:
> On Saturday, July 21, 2018 at 2:06:21 PM UTC-5, Sharan Basappa wrote:
> > Is there a difference between functions and methods in Python.
>
> Generally speaking, functions and methods are basically two
> words describi
Sharan Basappa writes:
> Refer to the following lines:
> 1) len(list)
> 2) list.append()
>
> In the first case, len is a function that python provides to which list can
> be passed and in the second case, append is a method within list class?
>
> If my interpretation is correct, why not make le
On 03/01/2018 04:58 PM, Ned Batchelder wrote:
> This sounds like it could make a good contribution to CPython :)
>
> --Ned.
Thanks for the recommendation. Issue/PR created:
https://bugs.python.org/issue32980
https://github.com/python/cpython/pull/5953
Cheers,
Thomas
--
https://
On 3/1/18 7:40 AM, Thomas Nyberg wrote:
On 03/01/2018 12:46 PM, bartc wrote:
If they're only called once, then it probably doesn't matter too much in
terms of harming performance.
Oh yeah there's no way this has any affect on performance. A smart
compiler might even be able optimize the call aw
On 03/01/2018 12:46 PM, bartc wrote:
> If they're only called once, then it probably doesn't matter too much in
> terms of harming performance.
Oh yeah there's no way this has any affect on performance. A smart
compiler might even be able optimize the call away entirely. Even if it
couldn't, it's
On 01/03/2018 09:57, Thomas Nyberg wrote:
Hello,
I was playing around with cpython and noticed the following. The
`_PyFrame_Init()` and `PyByteArray_Init()` functions are called in these
two locations:
https://github.com/python/cpython/blob/master/Python/pylifecycle.c#L693-L694
On Monday, September 19, 2016 at 6:54:31 PM UTC+12, dieter wrote:
> Some time ago, we had a (quite heated) discussion here ...
I have noticed that people get very defensive about things they don’t
understand.
> Often, functions returning functions are more difficult to understand
> than "first o
Lawrence D’Oliveiro writes:
> The less code you have to write, the better. Less code means less
> maintenance, and fewer opportunities for bugs.
While I agree with you in general, sometimes less code can be harder
to maintain (when it is more difficult to understand).
Some time ago, we had a (qu
On Sun, 18 Sep 2016 08:28 pm, Lawrence D’Oliveiro wrote:
> This shows the power of functions as first-class objects. The concept
> is older than object orientation, and is often left out of
> object-oriented languages. I think Python benefits from the fact that
> it had functions before it had cla
On Sun, May 10, 2015 at 9:25 PM, Dave Angel wrote:
> On 05/09/2015 11:33 PM, Chris Angelico wrote:
>> What you could have is "late-binding semantics, optional early binding
>> as an optimization but only in cases where the result is
>> indistinguishable". That would allow common cases (int/bool/st
On 05/09/2015 11:33 PM, Chris Angelico wrote:
On Sun, May 10, 2015 at 12:45 PM, Steven D'Aprano
wrote:
This is the point where some people try to suggest some sort of complicated,
fragile, DWIM heuristic where the compiler tries to guess whether the user
actually wants the default to use early
(To clarify, I am *not* talking about this as a change to Python, so
all questions of backward compatibility are immaterial. This is "what
happens if we go back in time and have Python use late binding
semantics". This is the "alternate 1985" of Back to the Future.)
On Sun, May 10, 2015 at 3:20 PM
On Sun, 10 May 2015 01:35 pm, Rustom Mody wrote:
> On Sunday, May 10, 2015 at 8:16:07 AM UTC+5:30, Steven D'Aprano wrote:
>> I predict that the majority of the time, late binding would just be a
>> pointless waste of time:
>>
>> def process_string(thestr, start=0, end=None, slice=1, reverse=True)
On Sun, 10 May 2015 01:33 pm, Chris Angelico wrote:
> On Sun, May 10, 2015 at 12:45 PM, Steven D'Aprano
> wrote:
>> This is the point where some people try to suggest some sort of
>> complicated, fragile, DWIM heuristic where the compiler tries to guess
>> whether the user actually wants the defa
On Sunday, May 10, 2015 at 8:16:07 AM UTC+5:30, Steven D'Aprano wrote:
> I predict that the majority of the time, late binding would just be a
> pointless waste of time:
>
> def process_string(thestr, start=0, end=None, slice=1, reverse=True):
> pass
>
> Why would you want 0, None, 1 and True
On Sun, May 10, 2015 at 12:45 PM, Steven D'Aprano
wrote:
> This is the point where some people try to suggest some sort of complicated,
> fragile, DWIM heuristic where the compiler tries to guess whether the user
> actually wants the default to use early or late binding, based on what the
> expres
On Sat, 9 May 2015 01:50 am, Michael Welle wrote:
[...]
>> How about this definition:
>>
>> default = 23
>> def spam(eggs=default):
>> pass
>>
>> del default
>>
>> print spam()
>>
>>
>> Do you expect the function call to fail because `default` doesn't exist?
>
> If I refer
On Fri, May 8, 2015 at 9:50 AM, Michael Welle wrote:
>
> Steven D'Aprano writes:
>>
>> If your language uses late binding, it is very inconvenient to get early
>> binding when you want it. But if your language uses early binding, it is
>> very simple to get late binding when you want it: just put
Chris Angelico wrote:
So no, it
isn't proof - it's equally well explained by the code object being
constant.
I suppose, strictly speaking, that's true -- but
then the code object *might as well* be created
at compile time, since the semantics are identical.
In any case, it's easy to see from
On Sat, 9 May 2015 03:49 am, Chris Angelico wrote:
> On Sat, May 9, 2015 at 3:36 AM, Steven D'Aprano
> wrote:
>> On Sat, 9 May 2015 02:02 am, Chris Angelico wrote:
>>> Aside from constructing two closures in the same context and proving
>>> that their __code__ attributes point to the same object,
On Sat, May 9, 2015 at 11:41 AM, Gregory Ewing
wrote:
> Chris Angelico wrote:
>>
>> How do you know that the function's code
>> object was created when compile() happened, rather than being created
>> when the function was defined?
>
>
> Python 3.4.2 (default, Feb 4 2015, 20:08:25)
> [GCC 4.2.1 (
Chris Angelico wrote:
How do you know that the function's code
object was created when compile() happened, rather than being created
when the function was defined?
Python 3.4.2 (default, Feb 4 2015, 20:08:25)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or
On Sat, 09 May 2015 03:49:36 +1000, Chris Angelico wrote:
> Yes, but can you *distinguish* them in terms of default argument versus
> code object creation? How do you know that the function's code object
> was created when compile() happened, rather than being created when the
> function was defin
On Sat, May 9, 2015 at 3:36 AM, Steven D'Aprano
wrote:
> On Sat, 9 May 2015 02:02 am, Chris Angelico wrote:
>> Aside from constructing two closures in the same context and proving
>> that their __code__ attributes point to the same object, is there any
>> way to distinguish between "code object co
On Sat, 9 May 2015 02:02 am, Chris Angelico wrote:
> On Sat, May 9, 2015 at 1:48 AM, Ian Kelly wrote:
>> On May 8, 2015 9:26 AM, "Steven D'Aprano"
>> wrote:
>>>
>>> Do you think that Python will re-compile the body of the function every
>>> time
>>> you call it? Setting the default is part of th
On Sat, 9 May 2015 01:48 am, Ian Kelly wrote:
> On May 8, 2015 9:26 AM, "Steven D'Aprano" <
> steve+comp.lang.pyt...@pearwood.info> wrote:
>>
>> Do you think that Python will re-compile the body of the function every
> time
>> you call it? Setting the default is part of the process of compiling th
On Sat, May 9, 2015 at 1:48 AM, Ian Kelly wrote:
> On May 8, 2015 9:26 AM, "Steven D'Aprano"
> wrote:
>>
>> Do you think that Python will re-compile the body of the function every
>> time
>> you call it? Setting the default is part of the process of compiling the
>> function.
>
> To be a bit peda
On May 8, 2015 9:26 AM, "Steven D'Aprano" <
steve+comp.lang.pyt...@pearwood.info> wrote:
>
> Do you think that Python will re-compile the body of the function every
time
> you call it? Setting the default is part of the process of compiling the
> function.
To be a bit pedantic, that's not accurate
On Fri, 8 May 2015 09:59 pm, Michael Welle wrote:
> Hello,
>
> assume the following function definition:
>
> def bar(foo = []):
> print("foo: %s" % foo)
> foo.append("foo")
>
> It doesn't work like one would expect (or as I would expect ;-)). As I
> understand it the assignment of the e
On Fri, May 8, 2015 at 9:59 PM, Michael Welle wrote:
> Hello,
>
> assume the following function definition:
>
> def bar(foo = []):
> print("foo: %s" % foo)
> foo.append("foo")
>
> It doesn't work like one would expect (or as I would expect ;-)). As I
> understand it the assignment of the e
On Friday, May 8, 2015 at 5:30:15 PM UTC+5:30, Michael Welle wrote:
> Hello,
>
> assume the following function definition:
>
> def bar(foo = []):
> print("foo: %s" % foo)
> foo.append("foo")
>
> It doesn't work like one would expect (or as I would expect ;-)). As I
> understand it the as
>
> Maybe http://pandas.pydata.org/ ???
>
>
Thanks. This reply is like that butterfly wing flap causing hurricanes a world
away; big steerage away from proprietary stuff used in my org. Detox will take
some time though.
K
--
https://mail.python.org/mailman/listinfo/python-list
On 2014-08-19 10:34, Kurt wrote:
> I am trying to process the following calendar and data attributes
> in a file: Da Mo Yr AttrA AttrB AttrC...
> I need to average AttrA for each of 365 Da days across Yr years.
> Then do the same for 27K files. Repeat for AttrB, AttrC etc. Can I
> do the averaging
On 19/08/2014 18:34, Kurt wrote:
I am trying to process the following calendar and data attributes in a file:
Da Mo Yr AttrA AttrB AttrC...
I need to average AttrA for each of 365 Da days across Yr years. Then do the
same for 27K files. Repeat for AttrB, AttrC etc.
Can I do the averaging with li
On 2014-02-24, Benjamin Kaplan wrote:
> On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote:
>> On 24/02/2014 11:09 AM, Mark Lawrence wrote:
>>>
>>> On 24/02/2014 00:55, alex23 wrote:
for _ in range(5):
func()
>>>
>>>
>>> the obvious indentation error above
>>
>>
>> Stupid
In article ,
Mark Lawrence wrote:
> On 24/02/2014 00:55, alex23 wrote:
> > On 23/02/2014 3:43 PM, Scott W Dunning wrote:
> >> I had a question regarding functions. Is there a way to call a
> >> function multiple times without recalling it over and over. Meaning
> >> is there a way I can call a
On Tue, 25 Feb 2014 02:18:43 -, Dennis Lee Bieber
wrote:
On Mon, 24 Feb 2014 01:01:15 -, "Rhodri James"
declaimed the following:
The function "range" returns the sequence of numbers 1, 2, 3, 4 and 5
[*],
so this has the same effect as if you had typed:
Wrong -- it
On 02/25/2014 07:52 PM, Ethan Furman wrote:
> On 02/23/2014 08:01 PM, ru...@yahoo.com wrote:
>> On 02/23/2014 08:21 PM, Mark Lawrence wrote:
>>> On 24/02/2014 02:55, Benjamin Kaplan wrote:
On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote:
> On 24/02/2014 11:09 AM, Mark Lawrence wrote:
>>
On 26/02/2014 02:06, Cameron Simpson wrote:
On 24Feb2014 13:59, Mark Lawrence wrote:
On 24/02/2014 04:01, ru...@yahoo.com wrote:
On 02/23/2014 08:21 PM, Mark Lawrence wrote:
On 24/02/2014 02:55, Benjamin Kaplan wrote:
On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote:
On 24/02/2014 11:09 AM, M
On 02/23/2014 08:01 PM, ru...@yahoo.com wrote:
On 02/23/2014 08:21 PM, Mark Lawrence wrote:
On 24/02/2014 02:55, Benjamin Kaplan wrote:
On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote:
On 24/02/2014 11:09 AM, Mark Lawrence wrote:
On 24/02/2014 00:55, alex23 wrote:
for _ in range(5):
On 23Feb2014 18:55, Benjamin Kaplan wrote:
> On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote:
> > On 24/02/2014 11:09 AM, Mark Lawrence wrote:
> >> On 24/02/2014 00:55, alex23 wrote:
> >>> for _ in range(5):
> >>> func()
> >>
> >> the obvious indentation error above
> >
> > Stupid cut&pas
On 24Feb2014 13:59, Mark Lawrence wrote:
> On 24/02/2014 04:01, ru...@yahoo.com wrote:
> >On 02/23/2014 08:21 PM, Mark Lawrence wrote:
> >>On 24/02/2014 02:55, Benjamin Kaplan wrote:
> >>>On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote:
> On 24/02/2014 11:09 AM, Mark Lawrence wrote:
> >On 2
- Original Message -
> On Feb 23, 2014, at 1:44 AM, Steven D'Aprano <
> steve+comp.lang.pyt...@pearwood.info > wrote:
> > Sorry, I don't really understand your question. Could you show an
> > example
>
> > of what you are doing?
>
> > Do you mean "add 5" or "*5"? "Add *5 doesn't really
On 24/02/2014 04:01, ru...@yahoo.com wrote:
On 02/23/2014 08:21 PM, Mark Lawrence wrote:
On 24/02/2014 02:55, Benjamin Kaplan wrote:
On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote:
On 24/02/2014 11:09 AM, Mark Lawrence wrote:
On 24/02/2014 00:55, alex23 wrote:
for _ in range(5):
On Sunday, 23 February 2014 05:43:17 UTC, Scott W Dunning wrote:
> I had a question regarding functions. Is there a way to call a function
> multiple times without recalling it over and over. Meaning is there a way I
> can call a function and then add *5 or something like that?
The followin
On Sunday, 23 February 2014 05:43:17 UTC, Scott W Dunning wrote:
> I had a question regarding functions. Is there a way to call a function
> multiple times without recalling it over and over. Meaning is there a way I
> can call a function and then add *5 or something like that?
>
The followi
On 02/23/2014 08:21 PM, Mark Lawrence wrote:
> On 24/02/2014 02:55, Benjamin Kaplan wrote:
>> On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote:
>>> On 24/02/2014 11:09 AM, Mark Lawrence wrote:
On 24/02/2014 00:55, alex23 wrote:
> for _ in range(5):
> func()
the obvious i
On 2014-02-24 03:21, Mark Lawrence wrote:
On 24/02/2014 02:55, Benjamin Kaplan wrote:
On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote:
On 24/02/2014 11:09 AM, Mark Lawrence wrote:
On 24/02/2014 00:55, alex23 wrote:
for _ in range(5):
func()
the obvious indentation error above
On 24/02/2014 02:55, Benjamin Kaplan wrote:
On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote:
On 24/02/2014 11:09 AM, Mark Lawrence wrote:
On 24/02/2014 00:55, alex23 wrote:
for _ in range(5):
func()
the obvious indentation error above
Stupid cut&paste :(
--
Your message c
On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote:
> On 24/02/2014 11:09 AM, Mark Lawrence wrote:
>>
>> On 24/02/2014 00:55, alex23 wrote:
>>>
>>>
>>> for _ in range(5):
>>> func()
>>
>>
>> the obvious indentation error above
>
>
> Stupid cut&paste :(
> --
Your message came through fine for
I understood what you meant because I looked up loops in the python
documentation since we haven’t got there yet in school.
On Feb 23, 2014, at 6:39 PM, alex23 wrote:
> On 24/02/2014 11:09 AM, Mark Lawrence wrote:
>> On 24/02/2014 00:55, alex23 wrote:
>>>
>>> for _ in range(5):
>>> f
On Feb 23, 2014, at 12:59 AM, Ben Finney wrote:
>
> You should ask question like this on the “python-tutor” forum.
Thanks Ben, I wasn’t aware of PythonTutor.
--
https://mail.python.org/mailman/listinfo/python-list
On 24/02/2014 11:09 AM, Mark Lawrence wrote:
On 24/02/2014 00:55, alex23 wrote:
for _ in range(5):
func()
the obvious indentation error above
Stupid cut&paste :(
--
https://mail.python.org/mailman/listinfo/python-list
> On Feb 23, 2014, at 17:09, Mark Lawrence wrote:
>
> For the benefit of newbies, besides the obvious indentation error above, the
> underscore basically acts as a dummy variable. I'll let the language lawyers
> give a very detailed, precise description :)
You mean a dummy name binding, rig
On Feb 23, 2014, at 1:44 AM, Steven D'Aprano
wrote:
>
> Sorry, I don't really understand your question. Could you show an example
> of what you are doing?
>
> Do you mean "add 5" or "*5"? "Add *5 doesn't really mean anything to me.
Sorry I forgot to add the code that I had to give an example
On 24/02/2014 00:55, alex23 wrote:
On 23/02/2014 3:43 PM, Scott W Dunning wrote:
I had a question regarding functions. Is there a way to call a
function multiple times without recalling it over and over. Meaning
is there a way I can call a function and then add *5 or something like
that?
The
On Sun, 23 Feb 2014 05:43:17 -, Scott W Dunning
wrote:
I had a question regarding functions. Is there a way to call a function
multiple times without recalling it over and over. Meaning is there a
way I can call a function and then add *5 or something like that?
The usual way to ca
On 23/02/2014 3:43 PM, Scott W Dunning wrote:
I had a question regarding functions. Is there a way to call a function
multiple times without recalling it over and over. Meaning is there a way I
can call a function and then add *5 or something like that?
The same way you repeat anything in P
On Sat, 22 Feb 2014 22:43:17 -0700, Scott W Dunning wrote:
> Hello,
>
> I had a question regarding functions. Is there a way to call a function
> multiple times without recalling it over and over. Meaning is there a
> way I can call a function and then add *5 or something like that?
Sorry, I
Scott W Dunning writes:
> I had a question regarding functions. Is there a way to call a
> function multiple times without recalling it over and over.
You should ask question like this on the “python-tutor” forum. I say
that because this question suggests you have yet to learn about basic
Pytho
12.4.2012 18:48, Kiuhnm kirjoitti:
On 4/11/2012 16:01, Antti J Ylikoski wrote:
On 9.4.2012 21:57, Kiuhnm wrote:
Do you have some real or realistic (but easy and self-contained)
examples when you had to define a (multi-statement) function and pass it
to another function?
Thank you.
Kiuhnm
A f
On 4/12/2012 19:29, Jan Kuiken wrote:
On 4/9/12 20:57 , Kiuhnm wrote:
Do you have some real or realistic (but easy and self-contained)
examples when you had to define a (multi-statement) function and pass it
to another function?
I don't use it daily but the first argument of list.sort, i.e. t
On 4/9/12 20:57 , Kiuhnm wrote:
Do you have some real or realistic (but easy and self-contained)
examples when you had to define a (multi-statement) function and pass it
to another function?
I don't use it daily but the first argument of list.sort, i.e. the
compare function springs to mind.
J
On 4/12/2012 8:07, Tim Roberts wrote:
Kiuhnm wrote:
That won't do. A good example is when you pass a function to re.sub, for
instance.
This is an odd request.
All shall be revealed :)
I often pass functions to functions in order to simulate a C switch
statement, such as in a language tr
On 4/11/2012 16:01, Antti J Ylikoski wrote:
On 9.4.2012 21:57, Kiuhnm wrote:
Do you have some real or realistic (but easy and self-contained)
examples when you had to define a (multi-statement) function and pass it
to another function?
Thank you.
Kiuhnm
A function to numerically integrate ano
Kiuhnm wrote:
>
>That won't do. A good example is when you pass a function to re.sub, for
>instance.
This is an odd request.
I often pass functions to functions in order to simulate a C switch
statement, such as in a language translator:
commands = {
'add': doAdd,
'subtract' : doSubt
On 04/10/12 08:36, Kiuhnm wrote:
On 4/10/2012 14:29, Ulrich Eckhardt wrote:
Am 09.04.2012 20:57, schrieb Kiuhnm:
That won't do. A good example is when you pass a function to
re.sub, for instance.
If that's a good example, then why not use it? I've used it on
multiple occasions to do lookups
On 9.4.2012 21:57, Kiuhnm wrote:
Do you have some real or realistic (but easy and self-contained)
examples when you had to define a (multi-statement) function and pass it
to another function?
Thank you.
Kiuhnm
A function to numerically integrate another function comes as follows:
On 04/11/2012 06:55 AM, Kiuhnm wrote:
> On 4/10/2012 23:43, Eelco wrote:
>> On Apr 10, 3:36 am, Kiuhnm wrote:
>>> On 4/10/2012 14:29, Ulrich Eckhardt wrote:
>>>
Am 09.04.2012 20:57, schrieb Kiuhnm:
> Do you have some real or realistic (but easy and self-contained)
> examples when you
On 4/10/2012 23:43, Eelco wrote:
On Apr 10, 3:36 am, Kiuhnm wrote:
On 4/10/2012 14:29, Ulrich Eckhardt wrote:
Am 09.04.2012 20:57, schrieb Kiuhnm:
Do you have some real or realistic (but easy and self-contained)
examples when you had to define a (multi-statement) function and pass it
to anot
On Tue, Apr 10, 2012 at 11:36 PM, Kiuhnm
wrote:
> On 4/10/2012 14:29, Ulrich Eckhardt wrote:
>>
>> Am 09.04.2012 20:57, schrieb Kiuhnm:
>>>
>>> Do you have some real or realistic (but easy and self-contained)
>>> examples when you had to define a (multi-statement) function and pass it
>>> to anoth
On Apr 10, 3:36 am, Kiuhnm wrote:
> On 4/10/2012 14:29, Ulrich Eckhardt wrote:
>
> > Am 09.04.2012 20:57, schrieb Kiuhnm:
> >> Do you have some real or realistic (but easy and self-contained)
> >> examples when you had to define a (multi-statement) function and pass it
> >> to another function?
>
On 4/10/2012 14:29, Ulrich Eckhardt wrote:
Am 09.04.2012 20:57, schrieb Kiuhnm:
Do you have some real or realistic (but easy and self-contained)
examples when you had to define a (multi-statement) function and pass it
to another function?
Take a look at decorators, they not only take non-trivi
Am 09.04.2012 20:57, schrieb Kiuhnm:
> Do you have some real or realistic (but easy and self-contained)
> examples when you had to define a (multi-statement) function and pass it
> to another function?
Take a look at decorators, they not only take non-trivial functions but
also return them. That s
On 4/9/2012 11:57 AM Kiuhnm said...
Do you have some real or realistic
... yes
(but easy and self-contained)
aah, no.
examples when you had to define a (multi-statement) function and pass it
to another function?
This weekend I added functionality to a subsystem that allows users to
On 4/9/2012 2:57 PM, Kiuhnm wrote:
Do you have some real or realistic (but easy and self-contained)
examples when you had to define a (multi-statement) function and pass it
to another function?
This is so common in Python that it is hardly worth sneezing about.
map(f, iterable)
filter(f, itera
On 9/5/2011 3:04 PM, Jean-Michel Pichavant wrote:
William Gill wrote:
Not to split hairs, but syntactically f(x) is a function in many
programming paradigms.
As I understand it functional programming places specific requirements
on functions, i.e.referential transparency. So f(x) may or may no
On 9/5/2011 1:45 PM, William Gill wrote:
On 9/4/2011 9:13 AM, rusi wrote:
On Sep 3, 9:15 pm, William Gill wrote:
During some recent research, and re-familiarization with Python, I came
across documentation that suggests that programming using functions, and
programming using objects were someho
William Gill wrote:
Not to split hairs, but syntactically f(x) is a function in many
programming paradigms.
As I understand it functional programming places specific requirements
on functions, i.e.referential transparency. So f(x) may or may not be
"functional".
x.f() is also a function,
On 9/3/2011 12:25 PM, Steven D'Aprano wrote:
William Gill wrote:
Are they suggesting that any function that takes an object as an
argument should always be a method of that object?
Yes.
I can think of times when a special application, such as a converter,
would take an object as an argumen
On 9/4/2011 9:13 AM, rusi wrote:
On Sep 3, 9:15 pm, William Gill wrote:
During some recent research, and re-familiarization with Python, I came
across documentation that suggests that programming using functions, and
programming using objects were somehow opposing techniques.
Staying with (fo
On Mon, Sep 5, 2011 at 9:41 AM, Steven D'Aprano
wrote:
> http://docs.python.org/dev/howto/functional.html
>
> What about the entire "Introduction" section, which starts with this
> statement?
>
> "This section explains the basic concept of functional programming"
>
> If you would like to suggest i
On 9/4/2011 7:41 PM, Steven D'Aprano wrote:
William Gill wrote:
The source of my error is "Functional Programming HOWTO
(/python-3.1.3-docs-html/howto/functional.html)"
For those who don't have access to William's local file system, I expect
he's looking at this:
http://docs.python.org/relea
William Gill wrote:
> The source of my error is "Functional Programming HOWTO
> (/python-3.1.3-docs-html/howto/functional.html)"
For those who don't have access to William's local file system, I expect
he's looking at this:
http://docs.python.org/release/3.1.3/howto/functional.html
or the most
On 9/4/2011 2:32 PM, Terry Reedy wrote:
On 9/4/2011 4:13 AM, tinn...@isbd.co.uk wrote:
Ian Kelly wrote:
Functional programming is about using functions in the *mathematical*
sense. A mathematical function maps one value (or tuple of values) to
another value. The mapped value never varies; if
On 9/4/2011 4:13 AM, tinn...@isbd.co.uk wrote:
Ian Kelly wrote:
Functional programming is about using functions in the *mathematical*
sense. A mathematical function maps one value (or tuple of values) to
another value. The mapped value never varies; if it did, it would be
a different functi
On Sep 3, 9:15 pm, William Gill wrote:
> During some recent research, and re-familiarization with Python, I came
> across documentation that suggests that programming using functions, and
> programming using objects were somehow opposing techniques.
Staying with (for the moment) the suggestion th
tinn...@isbd.co.uk wrote:
> I think there may be another issue here. If someone says "functional
> programming" to me then I would generally assume that they *do* mean
> "programming using functions".
Strictly speaking you are correct, "functional programming" does
mean "programming using func
Progranming with functions vs Progranming with objects sounds like C vs. C++
more than functional programming vs. OO programming
On 4 September 2011 04:18, William Gill wrote:
> On 9/3/2011 9:51 PM, Terry Reedy wrote:
>
>>
>> It is possible that our doc was less than crystal clear. We are
>> con
Ian Kelly wrote:
> On Sat, Sep 3, 2011 at 10:15 AM, William Gill wrote:
> > During some recent research, and re-familiarization with Python, I came
> > across documentation that suggests that programming using functions, and
> > programming using objects were somehow opposing techniques.
> >
> >
On 9/3/2011 9:51 PM, Terry Reedy wrote:
It is possible that our doc was less than crystal clear. We are
constantly improving it where we can see fixable faults. If you run
across whatever it was and it still seems a bit muddy, post something
again.
Will do.
Thanks.
--
http://mail.python.org/m
1 - 100 of 249 matches
Mail list logo