1. Germán Larraín
  2. py
  3. Pull requests

Pull requests

#1 Declined
Repository
Deleted repository
Branch
getattr (6b5fcc7a0ac1)
Repository
py
Branch
default

Make py.path.local more str-like

Author
  1. Ivan Smirnov
Reviewers
Description

When queried for an unknown attribute, LocalPath will first try to query its strpath for the same attributes, which makes py.path.local much more compatible with functions and API that except string paths (e.g., if a function uses .count, .endswith, .startswith, etc). Can optionally restrict the list of attributes to a certain subset of attributes/functions. Also implement len and contains for more compatibility. This doesn't seem to break any of the existing functionality according to the test suite.

Comments (1)