On 2012-04-30 13:41, Paul Emsley wrote: > On 30/04/12 01:03, Eddie Cao wrote: >> Hi Andrew, >> >> I also prefer #2. #1 is not quite sensible because many readers like >> MolFromSmiles will return None on failure and it will be hard to distinguish >> bad input from an empty one if we choose to do #1. Semantically, in many >> RDKit use cases, None and Empty Mol are as different as a webpage not found >> (HTTP 404) and a blank web page. > FWIW, I agree to #2 too. > > Paul.
My humble opinion would also be that #2 is the best option. In line with the analogy given by Eddie, treating an empty molecule as an error is equivalent to saying that a blank string is equal to NULL - which would be unfortunate, since there is a big semantic difference. Also, imagine that you delete all atoms and bonds in a molecule in order to replace them. Enforcing the semantics of "empty molecules are invalid" should then cause your code to break half-way through the process ? Cheers -- Jan Holst Jensen ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss