Modify

Ticket #107 (closed enhancement: invalid)

Opened 5 years ago

Last modified 5 years ago

remove unused variable in representer

Reported by: py4fun@… Owned by: xi
Priority: low Component: pyyaml
Severity: minor Keywords:
Cc:

Description

remove unused list self.object_keeper in representer

Index: C:/projects/workspace_python/PyYAML_2/lib/yaml/representer.py
===================================================================
--- C:/projects/workspace_python/PyYAML_2/lib/yaml/representer.py	(revision 298)
+++ C:/projects/workspace_python/PyYAML_2/lib/yaml/representer.py	(working copy)
@@ -26,14 +26,12 @@
         self.default_style = default_style
         self.default_flow_style = default_flow_style
         self.represented_objects = {}
-        self.object_keeper = []
         self.alias_key = None
 
     def represent(self, data):
         node = self.represent_data(data)
         self.serialize(node)
         self.represented_objects = {}
-        self.object_keeper = []
         self.alias_key = None
 
     def get_classobj_bases(self, cls):
@@ -54,7 +52,6 @@
                 #    raise RepresenterError("recursive objects are not allowed: %r" % data)
                 return node
             #self.represented_objects[alias_key] = None
-            self.object_keeper.append(data)
         data_types = type(data).__mro__
         if type(data) is types.InstanceType:
             data_types = self.get_classobj_bases(data.__class__)+list(data_types)

Attachments

unused_variable.patch Download (1.2 KB) - added by anonymous 5 years ago.

Change History

Changed 5 years ago by anonymous

comment:1 Changed 5 years ago by xi

  • Status changed from new to closed
  • Resolution set to invalid

object_keeper fixes #22.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.