I hereby claim:
- I am dowwie on github.
- I am dowwie (https://keybase.io/dowwie) on keybase.
- I have a public key ASCP2ZdSKPFGdm0BB6qVpYSEy4MYa8s29VooXlJn-9gnSgo
To claim this, I am signing this object:
I'm working full time porting the vast majority of Apache Shiro, a robust security management platform-framework written in Java, to Python 3. Porting is a massive undertaking and I could use some help. I'm working as quickly as possible, making things pythonic as I go. Interfaces and abstract objects will come last and any major refactoring will come even later. I have to get my arms around this beast first. | |
email me at [email protected] if you are interested in working together on this project | |
thanks to Les and Apache for making Shiro happen | |
It's not a question of *IF* this porting project will finish but *WHEN* -- the sooner I get help, the sooner the python community can benefit |
import timeit | |
import copy | |
from statistics import median, mean, stdev | |
def dictcopy1(): | |
a = {'one': 1, 'two': 2, 'three': 3} | |
b = dict(a) | |
return b |
from marshmallow import fields, Schema, pprint | |
from abc import ABCMeta, abstractmethod | |
class Serializable(metaclass=ABCMeta): | |
@classmethod | |
@abstractmethod | |
def serialization_schema(cls): | |
""" |
import timeit | |
class reify(object): | |
def __init__(self, wrapped): | |
self.wrapped = wrapped | |
try: | |
self.__doc__ = wrapped.__doc__ | |
except: # pragma: no cover | |
pass |
I hereby claim:
To claim this, I am signing this object:
# works for python 2.7 | |
import ctypes | |
import timeit | |
rustLib = "./libauthz.so" | |
assigned_perms = ["domain1:action3:target1", "domain1:action1,action2", "domain1:action4:target2"] | |
required_perm = "domain1:action4:target3" | |
def testRust(): |
package main | |
import ( | |
"C" | |
"fmt" | |
"strings" | |
"gopkg.in/fatih/set.v0" | |
) | |
type Permission struct { |
Guido van Rossum11 Sep 2012 - Public
Some patterns for fast Python. Know any others?
Avoid overengineering datastructures. Tuples are better than objects (try namedtuple too though). Prefer simple fields over getter/setter functions.
Built-in datatypes are your friends. Use more numbers, strings, tuples, lists, sets, dicts. Also check out the collections library, esp. deque.
Be suspicious of function/method calls; creating a stack frame is expensive.
""" | |
This is a python implementation of Craig Kerstiens blog post: | |
http://www.craigkerstiens.com/2017/06/08/working-with-time-in-postgres/ | |
""" | |
from random import randint | |
import functools | |
from datetime import datetime | |
import numpy as np | |
from arrow import Arrow |
#![feature(test)] | |
extern crate test; | |
#[macro_use] extern crate bencher; | |
#[macro_use] extern crate maplit; | |
use test::Bencher; | |
use std::collections::HashSet; | |
fn test_maplit() -> HashSet<&'static str> { |