Skip to content

Instantly share code, notes, and snippets.

View ionelmc's full-sized avatar
🙃
wat

Ionel Cristian Mărieș ionelmc

🙃
wat
View GitHub Profile

pycon

Python 3.5.1 (default, Dec 18 2015, 00:00:00) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os def delete(self, , stuff_id, user): user.objects.remove(stuff_id) def change(self,, stuff_id, params, user): pass

import pytest
class A(object):
def __init__(self, **kw):
for k, v in kw.items():
setattr(self, k, v)
class B(object):
@ionelmc
ionelmc / .gitignore
Last active February 12, 2020 09:26
A JSON parser benchmark. See README.rst for instructions.
*.cbor
*.log
*.xml
*.yaml
*.json
*.msgpack
*.html
*.marshal
*.pickle
.tox
__new__(<class 'file'>, '.coveragerc') <<< aspectlib/__init__.py:255:advising_function_wrapper < aspectlib/debug.py:177:__call__ < 2.7/ConfigParser.py:302:read < coverage/config.py:27:read < coverage/config.py:214:from_file < coverage/control.py:133:__init__ < pytest_cov/embed.py:58:init < <string>:4:<module> < <string>:1:<module> < <string>:167:addpackage
__new__ => <closed file ?, mode '<uninitialized file>' at 0x00007f0a64e70720>
{__builtin__.file}.__init__('.coveragerc') <<< aspectlib/__init__.py:255:advising_function_wrapper < aspectlib/debug.py:177:__call__ < 2.7/ConfigParser.py:302:read < coverage/config.py:27:read < coverage/config.py:214:from_file < coverage/control.py:133:__init__ < pytest_cov/embed.py:58:init < <string>:4:<module> < <string>:1:<module> < <string>:167:addpackage
{__builtin__.file}.__init__ => None
{__builtin__.file}.readline() <<< aspectlib/__init__.py:255:advising_function_wrapper < aspectlib/debug.py:177:__c
@ionelmc
ionelmc / python-dev.log
Created March 24, 2015 17:12
Fun times with simplejson on #python-dev
[2015-01-21 16:12:19] <ionelmc> haypo: it only happens when i got simplejson installed :-)
[2015-01-21 16:13:14] <haypo> ionelmc: so you know the fix, uninstall simplejson :-D
[2015-01-21 16:13:22] <haypo> ionelmc: it looks like a bug in this module
[2015-01-21 16:13:39] <haypo> ionelmc: python 2.7 provides a json module which is based on simplejson
[2015-01-21 16:13:51] <haypo> ionelmc: why not using the "builtin" json module?
[2015-01-21 16:14:08] <ionelmc> cauze someone was too lazy to cleanup the imports
[2015-01-21 16:14:19] <ionelmc> :-)
[2015-01-21 16:14:42] <ionelmc> haypo: so no speed difference?
[2015-01-21 16:14:50] <ionelmc> that someone is also too lazy to test :)
[2015-01-21 16:15:08] <Taggnostr2> ionelmc, in 2.7 the json module is accelerated in C, so it should be fast
SESSION.buffers.each(function (b) { if (!b.isServerLog()) { b.setShowingJoinPartPref(false) } });
SESSION.buffers.each(function (b) { if (!b.isServerLog()) { b.setTrackingUnreadPref(false) } });
SESSION.buffers.each(function (b) { if (!b.isServerLog() && b.getName() != "#python-ro") { b.setShowingJoinPartPref(false) } });
SESSION.buffers.each(function (b) { if (!b.isServerLog() && b.getName() != "#python-ro") { b.setTrackingUnreadPref(false) } });
Template variable Default Description
project_name

The reStructuredText Cheat Sheet: Syntax Reminders

Info

See <http://docutils.sf.net/rst.html> for introductory docs.

Author

David Goodger <goodger@python.org>

Date

$Date: 2013-02-20 01:10:53 +0000 (Wed, 20 Feb 2013) $

Revision

$Revision: 7612 $

Description

This is a "docinfo block", or bibliographic field list

Note

If you are reading this as HTML, please read

@ionelmc
ionelmc / custom.html
Last active August 29, 2015 14:14
EventDrops demo
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<link rel="stylesheet" href="style.css" />
<style type="text/css">
body {
font-family: verdana, sans-serif;
}
</style>
@ionelmc
ionelmc / bad.py
Created January 12, 2015 23:27
Pytest fixture linting
# This should not emit any complaints
import pytest
class App:
def __init__(self, smtp):
self.smtp = smtp
@pytest.fixture(scope="module")
def app(smtp):
return App(smtp)