On 07/08/2014 11:05 AM, Ben Hoyt wrote: >> Only exposing what the OS provides for free will make the API too difficult >> to use in the common case. But is there a nice way to expand the API that >> will allow the user who is trying to avoid extra expense know what >> information is already available? >> >> Even if the initial version doesn't have a way to check what information is >> there for free, ensuring there is a clean way to add this in the future >> would be really nice. > > We could easily add ".had_type" and ".had_lstat" properties (not sure > on the names), that would be true if the is_X information and lstat > information was fetched, respectively. Basically both would always be > True on Windows, but on POSIX only had_type would be True d_type is > present and != DT_UNKNOWN. > > I don't feel this is actually necessary, but it's not hard to add. > > Thoughts? Better to just have the attributes be None if they were not fetched. None is better than hasattr anyway, at least in the respect of not having to catch exceptions to function properly. -- ~Ethan~
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4