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
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst | |
index b2dd32f925e..09396b87245 100644 | |
--- a/Doc/library/functions.rst | |
+++ b/Doc/library/functions.rst | |
@@ -1780,6 +1780,13 @@ are always available. They are listed here in alphabetical order. | |
the second argument is a type, ``issubclass(type2, type)`` must be true (this | |
is useful for classmethods). | |
+ When called directly within an ordinary method of a class, both arguments may | |
+ be omitted ("zero-argument :func:`super`"). In this case, *type* will be the |
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
void _PyST_Dump(PySTEntryObject* ste, PyObject* prefix) | |
{ | |
const char *blocktype; | |
switch(ste->ste_type) { | |
case FunctionBlock: blocktype = "FunctionBlock"; break; | |
case ClassBlock: blocktype = "ClassBlock"; break; | |
case ModuleBlock: blocktype = "ModuleBlock"; break; | |
case AnnotationBlock: blocktype = "AnnotationBlock"; break; | |
case TypeVarBoundBlock: blocktype = "TypeVarBoundBlock"; break; | |
case TypeAliasBlock: blocktype = "TypeAliasBlock"; break; |
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
""" | |
SQLAlchemy, PostgreSQL (psycopg2), and autocommit | |
See blog post: http://oddbird.net/2014/06/14/sqlalchemy-postgres-autocommit/ | |
""" | |
from contextlib import contextmanager | |
from sqlalchemy import create_engine, event | |
from sqlalchemy.orm import sessionmaker, Session as BaseSession |
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
mainopt.json | |
============ | |
Performance version: 1.0.6 | |
Report on Linux-5.15.0-1028-aws-x86_64-with-glibc2.31 | |
Number of logical CPUs: 72 | |
Start date: 2023-02-13 15:59:52.702512 | |
End date: 2023-02-13 16:37:24.927583 | |
ic2opt.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
#!/bin/bash | |
# This hook is run after every virtualenv is activated. | |
export OLD_GEM_HOME=$GEM_HOME | |
export GEM_HOME=$VIRTUAL_ENV/gems/ | |
export GEM_PATH= | |
export PATH=$VIRTUAL_ENV/gems/bin:$PATH |
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 json | |
import requests | |
from websocket import create_connection | |
BASE = 'localhost:3000/socket.io/?EIO=3' | |
# First establish a polling-transport HTTP connection to get a session ID | |
url = 'http://%s&transport=polling' % BASE |
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
~$ bench-jobs compare req-compile-bench-1664914413-esnow req-compile-bench-1664903905-esnow | |
All benchmarks: | |
=============== | |
+-------------------------+------------------------------------------------------------------+------------------------------------------------------------------+ | |
| Benchmark | req-compile-bench-1664914413-esnow/pyperformance-results.json.gz | req-compile-bench-1664903905-esnow/pyperformance-results.json.gz | | |
+=========================+==================================================================+==================================================================+ | |
| unpickle | 13.7 us | 13.2 us: 1.04x faster | | |
+-------------------------+------------------------------------------------------------------+------------------------------------------------------------------+ |
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 StaticMethod(object): | |
def __init__(self, func): | |
self.func = func | |
def __get__(self, obj, cls): | |
return self.func | |
def staticmethod(func): |
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
""" | |
An alternative Django ``TEST_RUNNER`` which uses unittest2 test discovery from | |
a base path specified in settings, rather than requiring all tests to be in | |
``tests`` module of an app. | |
If you just run ``./manage.py test``, it'll discover and run all tests | |
underneath the ``TEST_DISCOVERY_ROOT`` setting (a path). If you run | |
``./manage.py test full.dotted.path.to.test_module``, it'll run the tests in | |
that module (you can also pass multiple modules). |
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
"""Utility for pulling settings from the environment.""" | |
import os | |
from urllib.parse import urlparse | |
class EnvParser: | |
"""Utility for getting settings from the OS environ. | |
Instantiate with the name of an env var to get the current mode from (that | |
env var should be set to one of VALID_MODES, or not set), then call the |
NewerOlder