Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have python parameter objects implement expected boolean conversions #1758

Merged
merged 1 commit into from Dec 12, 2013

Conversation

Dr15Jones
Copy link
Contributor

python allows implicit conversion of objects to a boolean. By default, objects always convert to ‘True’. This was unexpected for a ‘cms.bool(False)==True’. By implementing nonzero our objects now implicitly convert as expected. We also note that our list based parameters were already doing the proper conversion since they inherited from python’s built in list class.

python allows implicit conversion of objects to a boolean. By default, objects always convert to ‘True’. This was unexpected for a ‘cms.bool(False)==True’. By implementing __nonzero__ our objects now implicitly convert as expected. We also note that our list based parameters were already doing the proper conversion since they inherited from python’s built in list class.
@cmsbuild
Copy link
Contributor

A new Pull Request was created by @Dr15Jones (Chris Jones) for CMSSW_7_0_X.

Have python parameter objects implement expected boolean conversions

It involves the following packages:

FWCore/ParameterSet

@cmsbuild, @Dr15Jones, @ktf, @nclopezo can you please review it and eventually sign? Thanks.
@wmtan this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@ktf you are the release manager for this.

@Dr15Jones
Copy link
Contributor Author

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next IBs unless changes or unless it breaks tests. @ktf can you please take care of it?

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next IBs unless changes or unless it breaks tests. @ktf can you please take care of it?

ktf added a commit that referenced this pull request Dec 12, 2013
Framework -- Have python parameter objects implement expected boolean conversions
@ktf ktf merged commit bf9e727 into cms-sw:CMSSW_7_0_X Dec 12, 2013
@Dr15Jones Dr15Jones deleted the pythonObjectsCompareToBool branch December 12, 2013 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants