Skip to content

Commit

Permalink
Drop Python 3.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
un-def committed Mar 18, 2019
1 parent 5c4921b commit f5622cf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
1 change: 0 additions & 1 deletion .travis.yml
@@ -1,7 +1,6 @@
dist: xenial
language: python
python:
- 3.4
- 3.5
- 3.6
- 3.7
Expand Down
20 changes: 2 additions & 18 deletions polypie.py
@@ -1,6 +1,6 @@
from collections import OrderedDict
from functools import update_wrapper
from inspect import Parameter, signature
from inspect import signature
from typing import get_type_hints

from typeguard import check_argument_types, _CallMemo
Expand All @@ -18,21 +18,6 @@ class PolypieException(Exception):
pass


class HashableParameter(Parameter):

def __hash__(self):
return hash((self.name, self.kind, self.default, self.annotation))

@classmethod
def from_parameter(cls, parameter):
return cls(
name=parameter.name,
kind=parameter.kind,
default=parameter.default,
annotation=parameter.annotation
)


def _call_func(func_key, args=None, kwargs=None):
args = args or ()
kwargs = kwargs or {}
Expand Down Expand Up @@ -60,8 +45,7 @@ def polymorphic(func):
global _registry
func_key = func.__module__ + '.' + func.__qualname__
parameters = signature(func).parameters
parameters_tuple = tuple(
HashableParameter.from_parameter(p) for p in parameters.values())
parameters_tuple = tuple(parameters.values())
if func_key not in _registry:
def dispatcher(*args, **kwargs):
return _call_func(func_key, args, kwargs)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -23,6 +23,7 @@
version=version,
py_modules=['polypie'],
install_requires=['typeguard'],
python_requires='>=3.5',
license='BSD License',
description='Python polymorphic function declaration with obvious syntax',
long_description=long_description,
Expand All @@ -34,7 +35,6 @@
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py34,py35,py36,py37,flake8
envlist = py35,py36,py37,flake8

[testenv]
deps = pytest-cov
Expand Down

0 comments on commit f5622cf

Please sign in to comment.