The defendant, Wesley Omega McDonough, pleaded guilty to all three counts in the information besides admitting a prior kidnaping conviction. The first count charged kidnaping; the second count a sexual offense (fellatio) against the minor victim of the kidnaping; and the third count possession of a concealed weapon, after previous conviction of a felony.
According to the record, the defendant appeals,
“. . . from the order of the Court denying defendant’s motion for permission to withdraw his plea of guilty and to enter a plea of not guilty by reason of insanity; and further from the Court’s order sentencing defendant to state’s prison instead of recommitting defendant to a state hospital for further treatment.”
No appeal lies from an order denying a defendant permission to withdraw his plea and enter another plea. (People v. Ottenstror, 127 Cal.App.2d 104, 111 [273 P.2d 289]; People v. Broady, 120 Cal.App.2d 901, 902 [262 P.2d 669] ; People v. Morgan, 9 Cal.App.2d 612, 617 [50 P.2d 1061] ; People v. Phillips, 66 Cal.App.2d 837, 838 [153 P.2d 807].) However, if an appeal from the judgment of conviction has been properly taken, the alleged error in refusing to grant the defendant’s motion to withdraw his pleas may be reviewed. (People v. Alexander, 130 Cal.App.2d 529, 532 [279 P.2d 128].)
There is ample authority in California holding that no appeal lies from a “sentence” as distinguished from a “judgment.” (People v. Gallardo, 41 Cal.2d 57, 60 [257 P.2d 29]; People v. Grijalva, 48 Cal.App.2d 690, 691 [121 P.2d 32]; People v. Ray, 13 Cal.App.2d 701, 703 [57 P.2d 975] ; People v. Tidwell, 108 Cal.App.2d 60, 61 [238 P.2d 21] ; People v. Vandersee, 139 Cal.App.2d 388 [294 P.2d 77].) However, in late appellate cases there are holdings to the effect that the words “sentence” and “judgment” are interchangeable, that they mean the same thing, and that an appeal from the “sentence” is an appeal from the “judgment.” (People v. Tokich, 128 Cal.App.2d 515, 519 [275 P.2d *87816] ; People v. Ramirez, 143 Cal.App.2d 554 [300 P.2d 106] ; People v. Clarke, 146 Cal.App.2d Supp. 904 [304 P.2d 271] ; People v. Elledge, 186 Cal.App.2d 656 [9 Cal.Rptr. 188] ; People v. Carlson, 177 Cal.App.2d 201, 207 [2 Cal.Rptr. 117] ; People v. Horton, 191 Cal.App.2d 592, 594 [13 Cal.Rptr. 33].)
Rule 31(b) of the “Rules on Appeal” (50 Cal.2d 28) provides in part as follows:
“The notice [of appeal] shall be sufficient if it states in substance that the party appeals from a specified judgment or order or a particular part thereof, and shall be liberally construed in favor of its sufficiency.”
The form and spirit of this rule have induced holdings that an appeal from a sentence may be construed to be an appeal from the judgment. (People v. Robinson, 43 Cal.2d 143, 145 [271 P.2d 872]; People v. Hollis, 176 Cal.App.2d 92, 94 [1 Cal.Rptr. 293] ; People v. Scott, 186 Cal.App.2d 661, 663 [9 Cal.Rptr. 75].) We shall accordingly treat this appeal as one from the judgment.
Defendant was at all stages of the case represented by counsel, originally by the Public Defender of Tulare County and later by his present attorney. After the defendant entered his pleas of guilty, the criminal proceedings were suspended, and a hearing in sexual psychopathy was held. The two psychiatrists appointed by the court reported that the defendant was a sexual psychopath, and he was committed to the Atascadero State Hospital for an observation period of not to exceed 90 days.
On April 7, 1961, the Superintendent and Medical Director of Atascadero State Hospital filed his report and recommendation, stating that the defendant had been studied by the staff of the hospital and had been given “psychiatric, psychological and physical examinations, ’ ’ and that:
“Diagnosis is: Sociopathic personality disturbance, antisocial reaction with sexual deviation (adult homosexuality). In my opinion he is a sexual psychopath but will not benefit by care or treatment in a state hospital and is a menace to the health and safety of others.
“He may now be sentenced for the crime for which he is convicted or he may be recommitted for an indefinite period to the Department of Mental Hygiene for placement in an institutional unit for treatment of sexual psychopaths in a facility of the Department of Corrections. I recommend that he be sentenced for the crime.”
*88The defendant was returned to the committing court for a hearing on April 11, 1961; it was then that attorney J. M. Lopes was substituted as counsel for the defendant in place of the public defender. The court ordered that criminal proceedings be resumed, and called for a report of the probation officer. On May 11 the defendant served a notice of motion on the district attorney for leave to withdraw his plea of guilty in order to enter a plea of not guilty by reason of insanity as to each count and served an affidavit in support of the motion. On May 12, 1961, oral testimony in support of the motion and in opposition thereto was received; the court denied the motion for change of plea, refused probation and sentenced the defendant to state’s prison on each count, the sentences to run concurrently.
In his affidavit appellant avers that his attorney advised him to enter a plea of guilty, telling him that it would be the easiest way out, that there would be no publicity and that it would result in his hospitalization; that he entered his plea of guilty as advised and assumed that after his release from the hospital at Atascadero the proceedings would be ended; that he has been mentally ill and believes that at the time of the commission of the offenses he was insane and did not know right from wrong; that if he had known right from wrong the offenses would not have been committed by him; that he believes the public defender should have advised him to enter a plea of not guilty by reason of insanity; that he was never examined by any doctors appointed by the court, or otherwise, to determine whether or not he was insane at the time of the commission of the offenses; and that he received no treatment for his mental condition at Atascadero State Hospital.
In his oral testimony at the hearing he said that he was advised by the public defender to plead guilty and “. . . that would be the best way out”; that it was his understanding that upon his plea of guilty he would be hospitalized as a sexual psychopath. He further testified that at the time of the commission of the criminal acts he. was under an uncontrollable desire and did not know right from wrong, “. . . because the normal person wouldn’t commit an act like that”; that during his period of confinement he was not examined for insanity; and that he would not have entered a plea of guilty if he had known that he would be subject to a sentence on the criminal charges at a later date. On cross-examination, the defendant admitted that he had experienced sexual psychopathy proceedings in 1944 and had then been sent to a state *89hospital as a sexual psychopath and afterwards returned to the committing court where he was sentenced to state prison on the criminal charge; that he knew his acts of perversion were wrong on the occasions when those acts were discussed with the doctors, but that at the time of the commission of the acts he did not give it a thought as to whether such acts were right or wrong.
At the hearing the district attorney called Mr. Edward Kim, Public Defender of Tulare County, who had originally been appointed to represent appellant and who conferred with him prior to the entry by the defendant of his pleas. Mr. Kim testified that shortly after he was appointed he sat down with the defendant and discussed the facts of the case with him; the defendant admitted that he had committed the acts charged, and his counsel then talked with him with respect to what he was going to do about it. Mr. Kim learned in the conversation that his client had been arrested previously for this type of offense, that he had entered pleas of guilty to charges of the kind, that he had been treated as a sexual psychopath in connection therewith and thereafter brought back to court and sent to prison. Mr. Kim advised him that he could see no legal defense to the pending charges and that he probably should enter a plea of guilty and go through the sexual psychopathy proceeding. The defendant agreed; Mr. Kim continued:
“So then I told him that in the ordinary ease many times that when a person is sent to Atascadero as a sexual psychopath and is found to be one and is finally returned to court, on many occasions the Court would grant straight probation. However, I do remember this distinctly. I said in this case because of the fact that this wasn’t the first time that this happened to him, that the chances are at the conclusion of the sexual psychopathy proceedings that he would be brought back to Court and given some time in jail.”
On cross-examination, Mr. Kim testified that he had seen no indication that the defendant was mentally ill or insane, and that he had thought that a plea of not guilty by reason of insanity was inappropriate in view of the facts of the case and the attitude and appearance of the defendant. Mr. Kim denied that he told his client that there would be no publicity.
The medical reports of the psychiatrists appointed by the court and of the Superintendent and Medical Director of the Atascadero State Hospital, which are in the record, show that in their opinion the appellant is a sexual psychopath, but *90indicate that he is not suffering from any type of mental aberration that would warrant a plea of not guilty by reason of insanity.
In order to justify the granting of a change of plea the trial court should have before it clear and convincing evidence. (People v. Moffett, 137 Cal.App.2d 626, 629 [290 P.2d 667] ; People v. Ottenslror, supra, 127 Cal.App.2d 104, 109 [273 P.2d 289]; People v. Cooper, 123 Cal.App.2d 353, 356 [266 P.2d 566]; People v. Caruso, 174 Cal.App.2d 624, 634 [345 P.2d 282]; ■ People v. Griffin, 100 Cal.App.2d 546, 548 [224 P.2d 47].) The resolution of a conflict of evidence is primarily for the trier of fact. (People v. Ynostroza, 105 Cal.App.2d 332, 334 [232 P.2d 913]; People v. Kirk, 98 Cal. App.2d 687 [220 P.2d 976]; People v. Snowden, 149 Cal. App.2d 552, 558 [308 P.2d 815].)
In connection with an application for leave to withdraw a plea of guilty under section 1018 of the Penal Code, the court is vested with a broad discretion. (People v. Francis, 42 Cal.2d 335, 338 [267 P.2d 8]; People v. Cooper, supra, 123 Cal.App.2d 353, 355 [266 P.2d 566].) This discretion means a sound judicial discretion—not an arbitrary or fanciful choice of alternatives, but a reasonable and fair judicial determination of what is right under the law as applied to the facts. Discretion is abused only when “ . . the court exceeds the bounds of reason, all of the circumstances before it being considered, ’ ” (State Farm etc. Ins. Co. v. Superior Court, 47 Cal.2d 428, 432 [304 P.2d 13]) quoting Berry v. Chaplin, 74 Cal.App.2d 669, 672 [169 P.2d 453]). The question to be determined upon a plea of not guilty by reason of insanity is whether at the time of the commission of the offense a defendant’s mental faculties were so diseased and deranged that he was incapable of distinguishing right from wrong and whether he was aware of the wrongful nature of the act and of the fact that the offense was punishable by law. (14 Cal.Jur.2d, §63, pp. 247, 248.) People v. Nash, 52 Cal.2d 36, 39 [338 P.2d 416], footnote 1, states precisely the definition of legal insanity which is invoked by the plea of not guilty by reason of insanity:
“Queen v. M’Naughton (1843), 4 St.Tr. (N.S.) 847, 931, M’Naughton’s Case (1943), 10 Clark & Fin. 200, 210, 8 Eng. Rep. 718, 722, and this court (e.g., People v. Gorshen (1959), 51 Cal.2d at pp. 716, 726 [336 P.2d 492], footnote 5) state the basic rule as follows: that at the time the accused committed the act he was laboring under such a defect of reason, from *91disease of the mind, as not to know the nature and quality of his act or, if he did know it, that he did not know that he was doing what was wrong.”
(See also People v. Rittger, 54 Cal.2d 720 [7 Cal.Rptr. 901, 355 P.2d 645] ; People v. Berry, 44 Cal.2d 426 [282 P.2d 861] ; People v. Sturgess, 178 Cal.App.2d 435 [2 Cal.Rptr. 787].)
Our law does not recognize moral insanity, irresistible impulse, or homosexual or other sexual deviation as a legal defense for crime. (People v. Walter, 7 Cal.2d 438 [60 P.2d 990] ; People v. Kerrigan, 73 Cal. 222 [14 P. 849]; People v. McCarthy, 115 Cal. 255 [46 P. 1073] ; People v. Wilson, 28 Cal.2d 185 [168 P.2d 683]; People v. French, 12 Cal.2d 720, 730 [87 P.2d 1014] ; People v. Troche, 206 Cal. 35 [273 P. 767]; People v. Johnson, 115 Cal.App. 704 [2 P.2d 216] ; People v. Lizarraga, 108 Cal.App. 152 [291 P. 434].)
It has been held that the hope of receiving a shorter sentence by virtue of a plea of guilty is not a proper ground for setting aside the plea at a later time. (People v. Miller, 114 Cal. 10 [45 P. 986]; People v. Lennox, 67 Cal. 113 [7 P. 260].) And the fact that a defendant’s attorney has recommended that he enter a plea of guilty is in itself no basis for later setting aside the plea. (In re Hough, 24 Cal.2d 522, 532 [150 P.2d 448].)
It appears to us that the trial court acted within the legitimate limits of its discretion in refusing to permit the defendant to change his plea.
The purported appeal from the order of the court denying defendant’s motion for permission to withdraw his pleas of guilty and to enter pleas of not guilty by reason of insanity is dismissed and the judgment is affirmed.
Brown, J., and Stone, J., concurred.