Sebastian Linke added the comment:
Docstring could be:
Copy file content and permission bits of this path to the target path
and return a new Path instance pointing to the target path.
If target is a directory, the base filename of this path is added to
the target and a new file corresponding
New submission from Sebastian Linke :
pathlib.Path() could wrap shutil.copy() with something like this:
def copy(self, target):
if not self.is_file():
# No support for directories here
raise ValueError("Path must point to a regular file")
# copy() appends fil
Sebastian Linke added the comment:
The same behavior applies to f'{spam[}' and f'{spam(}'. Also to f'{spam{}', but
that might be expected.
This message is more clear:
>>> f'{spam('
File "", line 1
SyntaxError: f-string: mismatc
New submission from Sebastian Linke :
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> spam = 'spam'
>>
Sebastian Linke added the comment:
Slightly modified the implementation to return the index rather than a boolean.
--
Added file: http://bugs.python.org/file41374/subseq_index.patch
___
Python tracker
<http://bugs.python.org/issue25
Sebastian Linke added the comment:
@Josh
What is the point of using iterators here? If the user wants an iterator to be
checked then he can throw that iterator right away because it was exhausted by
the function. I think that in most cases the user wants to do some
postprocessing on a
New submission from Sebastian Linke:
With the attached patch I propose to add a new function to the "collections"
module. It is meant to be used for determining whether a given subsequence is
part of a particular sequence (with respect to the ordering of the
subsequence).
Doing th