Return the common part shared with the other path or None if there is no common part.
(self, other)
| 503 | return lst |
| 504 | |
| 505 | def common(self, other): |
| 506 | """Return the common part shared with the other path |
| 507 | or None if there is no common part. |
| 508 | """ |
| 509 | last = None |
| 510 | for x, y in zip(self.parts(), other.parts()): |
| 511 | if x != y: |
| 512 | return last |
| 513 | last = x |
| 514 | return last |
| 515 | |
| 516 | def __add__(self, other): |
| 517 | """Return new path object with 'other' added to the basename""" |