On 07/11/2019 13:36, Stephen Waldron wrote:
This is how it is at the moment, however it may be more agreeable, especially
if that is the only purpose of the function, for python users to be able to
define new functions inside of function calls.
No, not seeing it. Sorry, I don't think "I
Ok firstly, this idea was inspired specifically by a project I'm working on for
school concerning linked lists, in which I was trying to create a method that
performed a function on elements iteratively without having to navigate the
list from the head each time (of course taking the function
On Fri, Nov 8, 2019 at 11:22 PM Antoon Pardon wrote:
>
> On 8/11/19 13:00, Chris Angelico wrote:
> > On Fri, Nov 8, 2019 at 10:57 PM Antoon Pardon wrote:
> >> On 7/11/19 18:10, Stephen Waldron wrote:
> >>> What I'm aiming for is the ability to, within a function call, pass a
> >>> suite that
On 8/11/19 13:00, Chris Angelico wrote:
> On Fri, Nov 8, 2019 at 10:57 PM Antoon Pardon wrote:
>> On 7/11/19 18:10, Stephen Waldron wrote:
>>> What I'm aiming for is the ability to, within a function call, pass a suite
>>> that would be there automatically defined by the compiler/interpreter.
On Fri, Nov 8, 2019 at 10:57 PM Antoon Pardon wrote:
>
> On 7/11/19 18:10, Stephen Waldron wrote:
> > What I'm aiming for is the ability to, within a function call, pass a suite
> > that would be there automatically defined by the compiler/interpreter.
> > Another comment did mention lambda
On 7/11/19 18:10, Stephen Waldron wrote:
> What I'm aiming for is the ability to, within a function call, pass a suite
> that would be there automatically defined by the compiler/interpreter.
> Another comment did mention lambda functions, which does to some degree
> provide that capability,
Here is it rewritten using the proposal:
```
#Definition
def myFoo (str1, str2, foo, str = " "):
print( foo(str = str1), foo(str = str2) )
#Call
myFoo ("hello", "world!"):
str = list(str)[0].upper() + str[1:]
return str
```
Are you looking for multi-line
Thanks Antoon. I do suppose that it is kind of wrong to say the only way is to
"reference its [the function's] name" as an argument, however the point I was
trying to make was that it isn't possible to pass a function that is either not
in some way previously defined or a reference to something
Thanks Antoon. I do suppose that it is kind of wrong to say the only way is to
"reference its [the function's] name" as an argument, however the point I was
trying to make was that you cannot pass a function that is either not in some
way previously defined or a reference to something
On 7/11/19 14:36, Stephen Waldron wrote:
> Hi, I'm new to the group and to Python, so forgive me if I make any faux-pas
> here. As I can tell, the only way to pass a function as an argument is to
> reference its name as follows:
>
> def foo1(message):
> print(message)
>
> def foo2(foo,
10 matches
Mail list logo