Skip to content

Commit

Permalink
py2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfischer2781 committed Nov 16, 2017
1 parent 78d0438 commit e95e4ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions graphi/graph_io/csv.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Utilities for loading and storing Graphs
"""
from __future__ import absolute_import
import csv
import ast
import itertools
Expand Down
8 changes: 4 additions & 4 deletions graphi/types/adjacency_graph.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import absolute_import
from collections import abc as abc_collection
import collections as abc_collection
import six

from .. import abc
Expand All @@ -22,11 +22,11 @@ class AdjacencyGraph(abc.Graph):
O(len(:py:meth:`nodes`) = n) and O(len(:py:meth:`edges`) -> n\ :sup:`2`\ ),
respectively.
"""
def __init__(self, *source, undirected=False):
self.undirected = undirected
def __init__(self, *source, **kwargs):
self.undirected = kwargs.pop('undirected', False)
self._adjacency = {} # {node: {neighbour: distance, neighbour: distance, ...}, ...}
super(AdjacencyGraph, self).__init__(*source)
if undirected:
if self.undirected:
self._ensure_symmetry()

@staticmethod
Expand Down

0 comments on commit e95e4ee

Please sign in to comment.