core.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:FileStoreGAE 作者: liantian-cn 项目源码 文件源码
def _extract_indices(self, prefix, formdata):
        """
        Yield indices of any keys with given prefix.

        formdata must be an object which will produce keys when iterated.  For
        example, if field 'foo' contains keys 'foo-0-bar', 'foo-1-baz', then
        the numbers 0 and 1 will be yielded, but not neccesarily in order.
        """
        offset = len(prefix) + 1
        for k in formdata:
            if k.startswith(prefix):
                k = k[offset:].split('-', 1)[0]
                if k.isdigit():
                    yield int(k)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号