Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# str-only. | |
def fspath(path): | |
try: | |
path = path.__fspath__() | |
except AttributeError: | |
pass | |
if isinstance(path, str): | |
return path | |
else: | |
raise TypeError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+------------------------------------+---------------+---------------+--------------+-------------------------+ | |
| Benchmark | 3.5-perf.json | 3.6-perf.json | Change | Significance | | |
+====================================+===============+===============+==============+=========================+ | |
| 2to3 | 0.68 | 0.62 | 1.09x faster | Significant (t=65.03) | | |
+------------------------------------+---------------+---------------+--------------+-------------------------+ | |
| call_method | 0.02 | 0.02 | 1.07x faster | Significant (t=46.01) | | |
+------------------------------------+---------------+---------------+--------------+-------------------------+ | |
| call_method_slots | 0.02 | 0.02 | 1.06x faster | Significant (t=29.45) | | |
+------------------------------------+---------------+---------------+--------------+-------------------------+ | |
| call_method_un |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# hglookup.py | |
# | |
# Lookup a revision hash in a bunch of different hgwebdir repos. | |
# Also includes special treatment for subversion revisions from | |
# the CPython repo. | |
# | |
# Written by Georg Brandl, 2010. | |
import io | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pathlib | |
import re | |
SUMMARY_LINE_RE = re.compile(r':(?P<name>\S+) \((?P<code>.+?)\):( \*(?P<summary>.+)\*)?') | |
def parse_summary_line(line): | |
line_match = SUMMARY_LINE_RE.match(line) | |
if not line_match: | |
raise ValueError(f"ill-formed line: {line!r}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2018-06-18T21:57:18.905Z","extensionVersion":"v2.9.2"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import packaging.tags | |
def parse_wheel_filename(path): | |
name = os.path.splitext(_compat.fspath(path))[0] | |
index = len(name) | |
for _ in range(3): # interpreter, ABI, platform. | |
index = name.rindex("-", 0, index) | |
return packaging.tags.parse_tag(name[index + 1 :]) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Get VS Code versions | |
run: curl --output vscode-stable-versions.json https://update.code.visualstudio.com/api/releases/stable | |
- uses: actions/cache@v1 | |
with: | |
path: .vscode-test/ | |
key: ${{ runner.os }}-vscode-test-${{ hashFiles('vscode-stable-versions.json') }} | |
restore-keys: | | |
${{ runner.os }}-vscode-test- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE issues ( | |
recording_date TEXT NOT NULL DEFAULT CURRENT_DATE, | |
gh_num INTEGER NOT NULL CHECK(gh_num >= 1), | |
url TEXT NOT NULL, | |
title TEXT NOT NULL, | |
created TEXT NOT NULL, -- Date of issue creation | |
by_team INT NOT NULL DEFAULT 0 CHECK(upvotes >= 0), | |
assignee TEXT NULL, -- Who the issue is assigned to | |
last_OP_comment TEXT NULL, -- When the last comment from the OP was |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PowTest: | |
def __init__(self, name): | |
self.name = name | |
def __ipow__(self, _): | |
print(f"{self.name}.__ipow__") | |
return NotImplemented | |
def __pow__(self, _): | |
print(f"{self.name}.__pow__") |