Return a slice of s based on start and end indexes (that can be None).
(s, start, end)
| 961 | |
| 962 | |
| 963 | def substring(s, start, end): |
| 964 | """ |
| 965 | Return a slice of s based on start and end indexes (that can be None). |
| 966 | """ |
| 967 | startless = start is None |
| 968 | endless = end is None |
| 969 | if startless and endless: |
| 970 | return s |
| 971 | if endless: |
| 972 | return s[start:] |
| 973 | if startless: |
| 974 | return s[:end] |
| 975 | return s[start:end] |
| 976 | |
| 977 | |
| 978 | def has_basic_pom_attributes(pom): |