Skip to content

Fix abstract classes in 2.7 - #2247

Merged
ilevkivskyi merged 4 commits into
python:masterfrom
JelleZijlstra:abstract27
Jun 17, 2018
Merged

ilevkivskyi merged 4 commits into
python:masterfrom
JelleZijlstra:abstract27

Conversation

@JelleZijlstra

Copy link
Copy Markdown
Member

Part of #1476.

Comment thread stdlib/2/tempfile.pyi
# based on http: //docs.python.org/3.3/library/tempfile.html
# Adapted for Python 2.7 by Michal Pokorny

# TODO: Don't use basestring. Use Union[str, bytes] or AnyStr for arguments.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these TODOs still applies: the file contains no mention of basestring and no Union return types.

Comment thread stdlib/2/tempfile.pyi
def normcase(self, path: AnyStr) -> AnyStr: ...

class _TemporaryFileWrapper(IO[str]):
close_called = ... # type: bool

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This attribute doesn't actually exist on _TemporaryFileWrapper.

Comment thread stdlib/2/tempfile.pyi
from typing import Tuple, IO, Union, AnyStr, Any, overload, Iterator, List, Type, Optional

import thread
import random

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two imports are actually used below. I would actually write them as from random import Random and from thread import LockType.

@ilevkivskyi
ilevkivskyi merged commit 8084dc1 into python:master Jun 17, 2018
yedpodtrzitko pushed a commit to yedpodtrzitko/typeshed that referenced this pull request Jan 23, 2019
@JelleZijlstra
JelleZijlstra deleted the abstract27 branch May 30, 2020 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants