Re: making your own DirEntry.

2023-12-23 Thread immibis via Python-list
On 12/23/23 10:48, Antoon Pardon wrote: Op 22/12/2023 om 21:39 schreef DL Neil via Python-list: Why create a DirEntry? Why not go directly to os.mkdir() or whatever? Because I have functions with DirEntry parameters. Python is duck-typed, so it's quite likely that if you pass something tha

Re: making your own DirEntry.

2023-12-23 Thread Antoon Pardon via Python-list
Op 23/12/2023 om 12:34 schreef Barry Scott: On 23 Dec 2023, at 09:48, Antoon Pardon via Python-list wrote: Because I have functions with DirEntry parameters. I would duck-type a class I control to be my DirEnrry in this situation. Would also help you when debugging as you can tell inje

Re: making your own DirEntry.

2023-12-23 Thread Barry Scott via Python-list
> On 23 Dec 2023, at 09:48, Antoon Pardon via Python-list > wrote: > > Because I have functions with DirEntry parameters. I would duck-type a class I control to be my DirEnrry in this situation. Would also help you when debugging as you can tell injected DirEntry from "real" DirEntry. Barr

Re: making your own DirEntry.

2023-12-23 Thread Antoon Pardon via Python-list
Op 22/12/2023 om 21:39 schreef DL Neil via Python-list: Antoon, On 12/23/23 01:00, Antoon Pardon via Python-list wrote: I am writing a program that goes through file hierarchies and I am mostly using scandir for that which produces DirEntry instances. At times it would be usefull if I could

Re: making your own DirEntry.

2023-12-22 Thread DL Neil via Python-list
Antoon, On 12/23/23 01:00, Antoon Pardon via Python-list wrote: I am writing a program that goes through file hierarchies and I am mostly using scandir for that which produces DirEntry instances. At times it would be usefull if I could make my own DirEntry for a specific path, however when I t

making your own DirEntry.

2023-12-22 Thread Antoon Pardon via Python-list
I am writing a program that goes through file hierarchies and I am mostly using scandir for that which produces DirEntry instances. At times it would be usefull if I could make my own DirEntry for a specific path, however when I try, I get the following diagnostic: os.DirEntry('snap') Tracebac