Thomas 'PointedEars' Lahn wrote:
> Laura Creighton wrote:
>> and to create a class where none was before to make it more object-
>> oriented.
>
> I did not need to, but, again, it was more obvious that way. I could also
> have used an existing class, and its existing or newly added method.
> AI
Laura Creighton wrote:
> […] "Thomas 'PointedEars' Lahn" writes:
>> Laura Creighton wrote:
>>> […] "Thomas 'PointedEars' Lahn" [writes]:
Laura Creighton wrote:
> […] You really cannot make your code 'more functional' and 'more
> object-oriented' at the same time -- more in one style
On Sat, 25 Jul 2015 02:18 pm, Seb wrote:
> Hello,
>
> I'm fairly new to Python, struggling to write in a more object-oriented,
> functional style. I just wrote a function that takes two arrays
> representing sine (y) and cosine (x) angle coordinates, and returns the
> angle in degrees.
Alas, y
In a message of Sat, 25 Jul 2015 18:53:33 +0200, "Thomas 'PointedEars' Lahn" wr
ites:
>Laura Creighton wrote:
>
>> […] "Thomas 'PointedEars' Lahn" [writes]:
>>> Laura Creighton wrote:
[…] You really cannot make your code 'more functional' and 'more
object-oriented' at the same time -- mo
Thomas 'PointedEars' Lahn wrote:
> #
> class A:
> def __init__ (self, v=0):
> self._value = v
>
> def foo (self, f, b):
> return f(f, self._value, b)
I mean
return f(self._value, b)
--
Poin
Laura Creighton wrote:
> […] "Thomas 'PointedEars' Lahn" [writes]:
>> Laura Creighton wrote:
>>> […] You really cannot make your code 'more functional' and 'more
>>> object-oriented' at the same time -- more in one style implies less
>>> in the other.
>> How did you get that idea?
>
> Because pu
On Sat, 25 Jul 2015 14:44:43 +0200,
Laura Creighton wrote:
> And because I was rushed and posted without revision I left out
> something important.
>> So this is, quite likely, the pattern that you are looking for:
>> try: all_your_code_which_is_happy_with_non_scalars except
>> WhateverErrorPyt
Seb wrote:
> Hello,
>
> I'm fairly new to Python, struggling to write in a more object-oriented,
> functional style. I just wrote a function that takes two arrays
> representing sine (y) and cosine (x) angle coordinates, and returns the
> angle in degrees. I had initially written the function t
In a message of Sat, 25 Jul 2015 14:57:14 +0200, "Thomas 'PointedEars' Lahn" wr
ites:
>Laura Creighton wrote:
>
>> […] You really cannot make your code 'more functional' and 'more object-
>> oriented' at the same time -- more in one style implies less in the other.
>
>How did you get that idea?
B
Laura Creighton wrote:
> […] You really cannot make your code 'more functional' and 'more object-
> oriented' at the same time -- more in one style implies less in the other.
How did you get that idea?
--
PointedEars
Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
And because I was rushed and posted without revision I left out something
important.
>So this is, quite likely, the pattern that you are looking for:
>
>try:
> all_your_code_which_is_happy_with_non_scalars
>except WhateverErrorPythonGivesYouWhenYouTryThisWithScalars:
> whatever_you_wan
On Sat, Jul 25, 2015 at 9:01 PM, Laura Creighton wrote:
> How did I know to look for ValueErrors?
>
int("1.2")
> Traceback (most recent call last):
> File "", line 1, in
> ValueError: invalid literal for int() with base 10: '1.2'
>
> Cause that is what Python gives you. If it had given
You have a bit of a problem, in that "functional" and "object-oriented"
are two different styles of programming. You really cannot make your
code 'more functional' and 'more object-oriented' at the same time --
more in one style implies less in the other. I think you may have
got the mistaken ide
Hello,
I'm fairly new to Python, struggling to write in a more object-oriented,
functional style. I just wrote a function that takes two arrays
representing sine (y) and cosine (x) angle coordinates, and returns the
angle in degrees. I had initially written the function to take
array-like argume
14 matches
Mail list logo