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
# -*- encoding: utf-8 -*- | |
import unittest | |
class TestSomething(unittest.TestCase): | |
def test_unicode(self): | |
self.assertEqual(u'Русский', u'Текст') | |
if __name__ == '__main__': | |
import sys |
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
def test_non_utf8(self): | |
# Issue #16218 | |
with temp_dir() as script_dir: | |
script_basename = '\udcf1\udcea\udcf0\udce8\udcef\udcf2' | |
source = 'print("test output")\n' | |
script_name = _make_test_script(script_dir, script_basename, source) | |
if not __debug__: | |
run_args = ('-' + 'O' * sys.flags.optimize, script_name) | |
else: | |
run_args = (script_name,) |
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
def test_non_utf8(self): | |
# Issue #16218 | |
with temp_dir() as script_dir: | |
script_basename = '\udcf1\udcea\udcf0\udce8\udcef\udcf2' | |
source = 'print("test output")\n' | |
script_name = _make_test_script(script_dir, script_basename, source) | |
if not __debug__: | |
run_args = ('-' + 'O' * sys.flags.optimize, script_name) | |
else: | |
run_args = (script_name,) |
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
def test_non_utf8(self): | |
# Issue #16218 | |
with temp_dir() as script_dir: | |
script_basename = '\u0441\u043a\u0440\u0438\u043f\u0442' | |
try: | |
script_basename.encode(sys.getfilesystemencoding()) | |
except UnicodeEncodeError: | |
raise unittest.SkipTest("Filesystem doesn't support " | |
"unicode names") | |
source = 'print("test output")\n' |
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
[ui] | |
username = Andrew Svetlov <[email protected]> | |
merge = internal:merge | |
editor = emacs -nw | |
[diff] | |
git = on | |
showfunc = on | |
[extensions] |
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
// pymulti.cpp — основной код | |
#include <iostream> | |
#include <cstdlib> | |
#include <conio.h> | |
#include <boost/python.hpp> | |
#include <boost/thread.hpp> | |
using namespace std; | |
using namespace boost::python; |
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
from asyncio import * | |
@coroutine | |
def coro(): | |
proc = yield from create_subprocess_exec('true') | |
yield from proc.wait() | |
print('subprocess returncode', proc.returncode) | |
def thr(): |
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
[user] | |
name = Andrew Svetlov | |
email = [email protected] | |
[color] | |
ui = true | |
[alias] | |
lg = log --graph --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
st = status -sb | |
co = checkout | |
ci = commit |
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 asyncio | |
class A: | |
def __init__(self, reader, writter): | |
self.reader, self.writer = reader, writter | |
@asyncio.coroutine | |
def read_packet(self): | |
bsize = yield from self.reader.readexactly(4) |
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 asyncio | |
@asyncio.coroutine | |
def sender(queue): | |
print('sender started') | |
try: | |
yield from asyncio.sleep(3) | |
while True: | |
data = yield from queue.get() |
OlderNewer