EXCLUSIVE

Kim Richards was either a hopeless, pill-popping alcoholic the entire last season of "Real Housewives of Beverly Hills" or she was sober and doing better than ever ... depending on who you talk to on the cast and production crew.

Several sources involved in the production of the show tell TMZ ... Kim's protestations last season that she was sober were laughable.

We're told veteran cast members Kyle Richards, Lisa Vanderpump and Yolanda Foster learned to just look the other way to avoid confrontation, it was only new cast members Lisa Rinna and Eileen Davidson who dared to confront Kim.

The sources say Kim would never drink where anyone could see her ... she'd appear sober but then disappear in the restroom and emerge ... well, not sober.

But other sources connected to the show say Kim did better controlling her addiction last season than she has in years.

The most interesting cast member when it comes to Kim is Brandi Glanville. Sources in both camps say Brandi sides with them. If true, Brandi is playing both sides, which would be shocking, right?

Kim's sobriety became an issue during the dog biting incident. We're told Kim's camp sent a dog trainer to Kim's house to assess the situation, but the trainer found that Kim was such a mess, he had to help put her to bed.