Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-08, Thomas Passin via Python-list wrote: > >> Hi, I tested this with Python 3.8. Good to know that this was fixed! > > We just learned a few posts back that it might be specific to Linux; I > ran it on Windows. On Linux, the limit is imposed by the filesystem. Most of the "real"

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Thomas Passin via Python-list
On 3/8/2024 5:14 PM, Albert-Jan Roskam wrote: On Mar 8, 2024 19:35, Thomas Passin via Python-list wrote: On 3/8/2024 1:03 PM, Albert-Jan Roskam via Python-list wrote: > Hi, > I was replacing some os.path stuff with Pathlib and I discovered this: >

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Albert-Jan Roskam via Python-list
On Mar 8, 2024 19:35, Thomas Passin via Python-list wrote: On 3/8/2024 1:03 PM, Albert-Jan Roskam via Python-list wrote: > Hi, > I was replacing some os.path stuff with Pathlib and I discovered this: > Path(256 * "x").is_file() # OSError >

Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

2024-03-08 Thread Chris Angelico via Python-list
On Sat, 9 Mar 2024 at 03:42, Grant Edwards via Python-list wrote: > > On 2024-03-08, Chris Angelico via Python-list wrote: > > On Sat, 9 Mar 2024 at 00:51, Grant Edwards via Python-list > > wrote: > > > >> One might argue that "global" isn't a good choice for what to call the > >> scope in

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Thomas Passin via Python-list
On 3/8/2024 2:21 PM, Grant Edwards via Python-list wrote: On 2024-03-08, Thomas Passin via Python-list wrote: On 3/8/2024 1:03 PM, Albert-Jan Roskam via Python-list wrote: Hi, I was replacing some os.path stuff with Pathlib and I discovered this: Path(256 * "x").is_file() #

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-08, Grant Edwards via Python-list wrote: >> OSError: [Errno 36] File name too long: >>

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-08, Grant Edwards via Python-list wrote: > On 2024-03-08, Thomas Passin via Python-list wrote: >> On 3/8/2024 1:03 PM, Albert-Jan Roskam via Python-list wrote: >>> Hi, >>> I was replacing some os.path stuff with Pathlib and I discovered this: >>> Path(256 * "x").is_file()

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-08, Thomas Passin via Python-list wrote: > On 3/8/2024 1:03 PM, Albert-Jan Roskam via Python-list wrote: >> Hi, >> I was replacing some os.path stuff with Pathlib and I discovered this: >> Path(256 * "x").is_file() # OSError >> os.path.isfile(256 * "x") # bool >>

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Thomas Passin via Python-list
On 3/8/2024 1:03 PM, Albert-Jan Roskam via Python-list wrote: Hi, I was replacing some os.path stuff with Pathlib and I discovered this: Path(256 * "x").is_file() # OSError os.path.isfile(256 * "x") # bool Is this intended? Does pathlib try to resemble os.path as closely as

pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Albert-Jan Roskam via Python-list
Hi, I was replacing some os.path stuff with Pathlib and I discovered this: Path(256 * "x").is_file() # OSError os.path.isfile(256 * "x") # bool Is this intended? Does pathlib try to resemble os.path as closely as possible? Best wishes, Albert-Jan --

Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-08, Chris Angelico via Python-list wrote: > On Sat, 9 Mar 2024 at 00:51, Grant Edwards via Python-list > wrote: > >> One might argue that "global" isn't a good choice for what to call the >> scope in question, since it's not global. It's limited to that source >> file. It doesn't make

Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

2024-03-08 Thread Chris Angelico via Python-list
On Sat, 9 Mar 2024 at 00:51, Grant Edwards via Python-list wrote: > One might argue that "global" isn't a good choice for what to call the > scope in question, since it's not global. It's limited to that source > file. It doesn't make sense to me to call a binding "global", when > there can be

Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-07, Cameron Simpson via Python-list wrote: > Yes. Note that the "global" namespace is the module in which the > function is defined. One might argue that "global" isn't a good choice for what to call the scope in question, since it's not global. It's limited to that source file. It