Bug 656975 - collisions with builtin functions
collisions with builtin functions
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
Unspecified Unspecified
low Severity medium
: rc
: ---
Assigned To: Bryan Kearney
Bryan Kearney
Depends On:
Blocks: rhsm-rhel62
  Show dependency treegraph
Reported: 2010-11-24 10:52 EST by Miroslav Suchý
Modified: 2011-07-28 14:05 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-07-28 14:05:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Miroslav Suchý 2010-11-24 10:52:48 EST
It is not quite safe to name variable with the same name, which match to python builtin function.

While "Method could be a function" can be ignored, "Redefining built-in" should be fixed.

116:Certificate.valid: Redefining built-in 'range'
196:Certificate.__cmp__: Redefining built-in 'range'
639:ProductCertificate.getProduct: Redefining built-in 'hash'
654:ProductCertificate.getProducts: Redefining built-in 'hash'
846:Product.__init__: Redefining built-in 'hash'
121:Certificate.bogus: Method could be a function
275:DateRange._convert_to_utc: Method could be a function
422:Extensions.__ext: Method could be a function

301:Directory.listAll: Redefining built-in 'all'
318:Directory.listdirs: Redefining built-in 'dir'
404:CertificateDirectory.findAllByProduct: Redefining built-in 'hash'
412:CertificateDirectory.findByProduct: Redefining built-in 'hash'
89:Action.build: Method could be a function
141:UpdateAction.syslogResults: Method could be a function
163:UpdateAction.getExpected: Method could be a function
168:UpdateAction.bashSerials: Method could be a function
180:UpdateAction.delete: Method could be a function
209:UpdateAction.mayLinger: Method could be a function
227:Writer.__ufn: Method could be a function
420:CertificateDirectory.certClass: Method could be a function
573:UpdateReport.write: Method could be a function

245:UEPConnection.registerConsumer: Redefining built-in 'type'
132:Restlib.validateResponse: Method could be a function

94:Lock.__init__: Redefining built-in 'dir'

557:ListCommand._format_name: Method could be a function
91:CliCommand.assert_should_be_registered: Method could be a function

7:list_pools: Redefining built-in 'all'

371:list_pools: Redefining built-in 'all'
385:getAvailableEntitlements: Redefining built-in 'all'
333:PoolFilter.filter_product_name: Method could be a function
280:PoolFilter.filter_pools_by_products: Method could be a function

104:ProductManager.updateInstalled: Redefining built-in 'hash'
117:ProductManager.updateRemoved: Redefining built-in 'hash'

89:UpdateAction.getContent: Redefining built-in 'id'
127:Repo.__init__: Redefining built-in 'id'
132:Repo._clean_id: Redefining built-in 'id'
101:UpdateAction.join: Method could be a function

114:Hardware._get_dmi_data: Method could be a function

32:Facts.read: Method could be a function

65:UpdateAction.updateFacts: Method could be a function
Comment 5 Bryan Kearney 2011-06-23 16:46:42 EDT
Fixed in 3f54299dee5ebb882ac340de00dd2102adb75c68. Checked into master.
Comment 8 Miroslav Suchý 2011-06-29 05:39:31 EDT
in subscription-manager git:

[msuchy@dri/~/rhn/subscription-manager{master}]$ find src -name '*.py'|xargs pylint |grep built-in
No config file found, using default configuration
W:131:UpdateAction.get_content: Redefining built-in 'id'
W:192:Repo.__init__: Redefining built-in 'id'
W:200:Repo._clean_id: Redefining built-in 'id'
W:327:CellRendererDate.do_set_property: Redefining built-in 'property'
W:122:ProductManager.updateInstalled: Redefining built-in 'hash'
W:154:ProductManager.updateRemoved: Redefining built-in 'hash'
W:278:Directory.listAll: Redefining built-in 'all'
W:295:Directory.listdirs: Redefining built-in 'dir'
W:381:CertificateDirectory.findAllByProduct: Redefining built-in 'hash'
W:389:CertificateDirectory.findByProduct: Redefining built-in 'hash'
W:140:Hardware.getDistribution: Redefining built-in 'id'
W: 95:Lock.__init__: Redefining built-in 'dir'
W:343:list_pools: Redefining built-in 'all'
W:360:getAvailableEntitlements: Redefining built-in 'all'
Comment 9 Bryan Kearney 2011-06-29 06:47:57 EDT
please look at http://git.fedorahosted.org/git/?p=subscription-manager.git
Comment 11 RHEL Product and Program Management 2011-07-28 14:05:32 EDT
Quality Engineering Management has reviewed and declined this request.  You may
appeal this decision by reopening this request.

Note You need to log in before you can comment on or make changes to this bug.