Re: tail

2022-05-11 Thread Avi Gross via Python-list
This seems to be a regular refrain where someone wants something as STANDARD in a programming language or environment and others want to keep it lean and mean or do not see THIS suggestion as particularly important or useful. Looking at the end of something is extremely common. Packages like

Re: tail

2022-05-11 Thread Avi Gross via Python-list
Just FYI, UNIX had a bunch of utilities that could emulate a vanilla version of tail on a command line. You can use sed, awk and quite a few others to simply show line N to the end of a file or other variations.  Of course the way many things were done back then had less focus on efficiency

Re: tail

2022-05-11 Thread Dennis Lee Bieber
On Thu, 12 May 2022 06:07:18 +1000, Chris Angelico declaimed the following: >I don't understand why this wants to be in the standard library. > Especially as any Linux distribution probably includes the compiled "tail" command, so this would only be of use on Windows. Under

Re: tail

2022-05-11 Thread Chris Angelico
On Thu, 12 May 2022 at 07:27, Marco Sulla wrote: > > On Wed, 11 May 2022 at 22:09, Chris Angelico wrote: > > > > Have you actually checked those three, or do you merely suppose them to be > > true? > > I only suppose, as I said. I should do some benchmark and some other > tests, and, frankly, I

Re: tail

2022-05-11 Thread Marco Sulla
On Wed, 11 May 2022 at 22:09, Chris Angelico wrote: > > Have you actually checked those three, or do you merely suppose them to be > true? I only suppose, as I said. I should do some benchmark and some other tests, and, frankly, I don't want to. I don't want to because I'm quite sure the

Re: tail

2022-05-11 Thread Chris Angelico
On Thu, 12 May 2022 at 06:03, Marco Sulla wrote: > I suppose this function is fast. It reads the bytes from the file in chunks > and stores them in a bytearray, prepending them to it. The final result is > read from the bytearray and converted to bytes (to be consistent with the > read method). >

Re: tail

2022-05-11 Thread Marco Sulla
On Mon, 9 May 2022 at 23:15, Dennis Lee Bieber wrote: > > On Mon, 9 May 2022 21:11:23 +0200, Marco Sulla > declaimed the following: > > >Nevertheless, tail is a fundamental tool in *nix. It's fast and > >reliable. Also the tail command can't handle different encodings? > > Based upon >

Re: Changing calling sequence

2022-05-11 Thread anthony.flury via Python-list
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. -- Original Message -- From: "Michael F. Stemper" To: python-list@python.org

Re: Changing calling sequence

2022-05-11 Thread Grant Edwards
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: >

RE: Changing calling sequence

2022-05-11 Thread David Raymond
>> 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 >>

Re: Changing calling sequence

2022-05-11 Thread 2QdxY4RzWzUUiLuE
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

Re: Changing calling sequence

2022-05-11 Thread Tobiah
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

Changing calling sequence

2022-05-11 Thread Michael F. Stemper
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