On Fri, Feb 6, 2009 at 4:02 PM, yury nedelin <[email protected]> wrote:
> Hey Ryan, > > yes > using "if" is fine, it just seem not very elegant. > > I do not like having to check all the time. > > Pymel is cool but I want to stick with maya python as it comes with maya. > > Fewer special needs fewer bugs. > > I guess its I will have to keep checking > > Maya should return empty list instead of nothing. But I might still be > missing something. > > Yury > > > On Fri, Feb 6, 2009 at 3:19 PM, ryant <[email protected]> wrote: > >> >> I dont think his question has anything to do with pymel. My point was >> if you use the if statement as designed it doesnt matter what the >> value is that is returned. Python returns True if the value is usable >> and false if it is not. Dont get me wrong I took a look at pymel and >> you guys are doing some great things with it. >> >> None == False >> 0 == False >> 1 == True >> 2 == True >> [] == False >> [0] == True >> {} == False >> {1:1} == True >> () == False >> (1) == True >> >> >> >> On Feb 6, 2:29 pm, chadrik <[email protected]> wrote: >> > use pymel :) >> > >> > On Feb 6, 2009, at 1:25 PM, yury nedelin wrote: >> > >> > > let say >> > >> > > mc.select(clear=1) >> > > print mc.ls(sl=1) >> > > >>None >> > >> > > I have to check if its "None" or a list if I want to do a For loop >> > > anything else with the List >> > >> > > Are there better ways than checking >> if "None" >> all the time ? >> > >> > > Thanks >> > > Yury >> >> >> > --~--~---------~--~----~------------~-------~--~----~ Yours, Maya-Python Club Team. -~----------~----~----~----~------~----~------~--~---
