File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99# the GNU General License
1010# ----------------------------------------------------------------------
1111
12- import re
1312from collections import Counter
1413
1514from typing import Optional
@@ -78,25 +77,6 @@ def t(self):
7877
7978 return self ._t
8079
81- def copy_attr (self , other ):
82- """ Copies all other attributes (not methods)
83- from the other object to this instance.
84- """
85- if not isinstance (other , Symbol ):
86- return # Nothing done if not a Symbol object
87-
88- tmp = re .compile ('__.*__' )
89- for attr in (x for x in dir (other ) if not tmp .match (x )):
90- if (
91- hasattr (self .__class__ , attr ) and
92- str (type (getattr (self .__class__ , attr )) in ('property' , 'function' , 'instancemethod' ))
93- ):
94- continue
95-
96- val = getattr (other , attr )
97- if isinstance (val , str ) or str (val )[0 ] != '<' : # Not a value
98- setattr (self , attr , val )
99-
10080 @property
10181 def is_needed (self ) -> bool :
10282 return len (self .required_by ) > 0
You can’t perform that action at this time.
0 commit comments