[Pulp-list] Usage of id as variable name

Jason Connor jconnor at redhat.com
Thu Aug 2 20:53:02 UTC 2012


Accidentally replied privately last time.

This is good practice for another reason as well: We tend to end up implementing cross-collection functionality and usually have more than one id floating around. It's a lot easier to keep them straight if they're all prefixed.

Jason L Connor
linear on freenode #pulp
http://pulpproject.org/
RHCE: 805010912355231
GPG Fingerprint: 2048R/CC4ED7C1



On Jul 31, 2012, at 10:55 PM, Jason Connor <jconnor at redhat.com> wrote:

> +1
> 
> Jason L Connor
> linear on freenode #pulp
> http://pulpproject.org/
> RHCE: 805010912355231
> GPG Fingerprint: 2048R/CC4ED7C1
> 
> 
> 
> On Jul 31, 2012, at 2:04 PM, James Slagle <jslagle at redhat.com> wrote:
> 
>> Looking around, I see usage of id as a variable name.  id is actually a python
>> built-in.  I don't know of any specific issues (debuggers perhaps) overriding
>> it might cause, but in general, I think it's a good idea not to override
>> built-ins with local variables names.
>> 
>> I've cleaned up a few areas that I'm working in.  But, it might be a good idea
>> to do a mass cleanup as well.
>> 
>> I would also argue id doesn't make a great variable name anyway :).  It would
>> probably be more clear to use repo_id, consumer_id, etc.
>> 
>> --
>> -- James Slagle
>> --
>> 
>> _______________________________________________
>> Pulp-list mailing list
>> Pulp-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/pulp-list
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-list/attachments/20120802/fcc1d6d6/attachment.htm>


More information about the Pulp-list mailing list