Skip to content

Updating code to Python 3 #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ sudo: false

matrix:
include:
- python: "2.7"
env: TOXENV=ci27
- python: "3.6"
env: TOXENV=ci36
- python: "3.7"
env: TOXENV=ci37
- python: "3.8"
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ In some cases class-level docstring with doctest would also help (see [adapter.p
but readable OUTPUT section is much better.


##### Python2/3 compatibility
Try to keep it (discussion is held in [issue #208](https://github.com/faif/python-patterns/issues/208))
- use new style classes (inherit from `object`)
- use `from __future__ import print_function`
##### Python2 compatibility
To see Python 2 compatible versions of some patterns please check-out `legacy` tag.

##### Update README
When everything else is done - update corresponding part of README.
Expand Down
119 changes: 0 additions & 119 deletions patterns/behavioral/chain_of_responsibility__py2.py

This file was deleted.

File renamed without changes.
50 changes: 0 additions & 50 deletions patterns/behavioral/registry__py2.py

This file was deleted.

5 changes: 1 addition & 4 deletions patterns/creational/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ def __del__(self):


def main():
try:
import queue
except ImportError: # python 2.x compatibility
import Queue as queue
import queue

def test_object(queue):
pool = ObjectPool(queue, True)
Expand Down
File renamed without changes.
123 changes: 0 additions & 123 deletions patterns/other/blackboard__py2.py

This file was deleted.

File renamed without changes.
Loading