On 16/05/22 1:20 am, 2qdxy4rzwzuui...@potatochowder.com wrote:
IMO,
classmethods were/are a bad idea (yes, I'm probably in the minority
around here, but someone has to be).
I don't think class methods are a bad idea per se, but having
them visible through instances seems unnecessary and confusi
On 2022-05-15 at 14:44:09 +1000,
Chris Angelico wrote:
> On Sun, 15 May 2022 at 14:27, dn wrote:
> >
> > On 15/05/2022 11.34, 2qdxy4rzwzuui...@potatochowder.com wrote:
> > > On 2022-05-15 at 10:22:15 +1200,
> > > dn wrote:
> > >
> > >> That said, a function which starts with a list of ifs-buts-
On Sun, 15 May 2022 at 14:27, dn wrote:
>
> On 15/05/2022 11.34, 2qdxy4rzwzuui...@potatochowder.com wrote:
> > On 2022-05-15 at 10:22:15 +1200,
> > dn wrote:
> >
> >> That said, a function which starts with a list of ifs-buts-and-maybes*
> >> which are only there to ascertain which set of argumen
On 15/05/2022 11.34, 2qdxy4rzwzuui...@potatochowder.com wrote:
> On 2022-05-15 at 10:22:15 +1200,
> dn wrote:
>
>> That said, a function which starts with a list of ifs-buts-and-maybes*
>> which are only there to ascertain which set of arguments have been
>> provided by the calling-routine; obscu
On 2022-05-15 at 10:22:15 +1200,
dn wrote:
> That said, a function which starts with a list of ifs-buts-and-maybes*
> which are only there to ascertain which set of arguments have been
> provided by the calling-routine; obscures the purpose/responsibility
> of the function and decreases its reada
On 12/05/2022 01.33, Michael F. Stemper wrote:
> I have a function that I use to retrieve daily data from a
> home-brew database. Its calling sequence is;
>
> def TempsOneDay( year, month, date ):
>
> After using it (and its friends) for a few years, I've come to
> realize that there are times wh
You probably want something like overload/multiple dispatch. I quick search
on PyPI yields a 'multipledispatch' package.
I never used, however.
On Wed, May 11, 2022 at 08:36:26AM -0700, Tobiah wrote:
On 5/11/22 06:33, Michael F. Stemper wrote:
I have a function that I use to retrieve daily dat
On 11/05/2022 14.58, anthony.flury wrote:
Why not do :
def TempsOneDayDT(date:datetime.date):
return TempsOneDay(date.year, date.month, date.day)
No repeat of code - just a different interface to the same functionality.
Yeah, a one-line wrapper around the original functi
>>def TempsOneDay(*dateComponents):
>>if len(dateComponents) == 3:
>>year, month, date = dateComponents
>>elif len(dateComponents) == 1 and isinstance(dateComponents[0],
>> datetime.date):
>>year, month, date = (dateComponents[0].year, dateComponents[0].month,
>> dateCompo
python.org
Sent: Wednesday, 11 May, 22 At 14:33
Subject: Changing calling sequence
I have a function that I use to retrieve daily data from a
home-brew database. Its calling sequence is;
def TempsOneDay( year, month, date ):
After using it (and its friends) for a few years, I've come to
realize
On 2022-05-11, David Raymond wrote:
> Maybe not the prettiest, but you could also define it like this,
> which also wouldn't require changing of any existing calls or the
> main body of the function past this if block.
>
> def TempsOneDay(*dateComponents):
> if len(dateComponents) == 3:
>
>> I have a function that I use to retrieve daily data from a
>> home-brew database. Its calling sequence is;
>>
>> def TempsOneDay( year, month, date ):
>>
>> After using it (and its friends) for a few years, I've come to
>> realize that there are times where it would be advantageous to
>> invok
On 2022-05-11 at 08:33:27 -0500,
"Michael F. Stemper" wrote:
> I have a function that I use to retrieve daily data from a
> home-brew database. Its calling sequence is;
>
> def TempsOneDay( year, month, date ):
>
> After using it (and its friends) for a few years, I've come to
> realize that th
On 5/11/22 06:33, Michael F. Stemper wrote:
I have a function that I use to retrieve daily data from a
home-brew database. Its calling sequence is;
def TempsOneDay( year, month, date ):
After using it (and its friends) for a few years, I've come to
realize that there are times where it would be
I have a function that I use to retrieve daily data from a
home-brew database. Its calling sequence is;
def TempsOneDay( year, month, date ):
After using it (and its friends) for a few years, I've come to
realize that there are times where it would be advantageous to
invoke it with a datetime.da
15 matches
Mail list logo