알파벳 문자, 숫자 및 밑줄을 제외하고 파이썬 함수 이름에 허용되는 다른 문자가 있습니까? 그렇다면 무엇입니까?파이썬 함수 이름에 허용되는 문자
11
A
답변
14
Python 2.x에는 없습니다. the docs에서 :
identifier ::= (letter|"_") (letter | digit | "_")*
letter ::= lowercase | uppercase
lowercase ::= "a"..."z"
uppercase ::= "A"..."Z"
digit ::= "0"..."9"
identifier ::= xid_start xid_continue*
id_start ::= <all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl,
the underscore, and characters with the Other_ID_Start property>
id_continue ::= <all characters in id_start, plus characters in the categories
Mn, Mc, Nd, Pc and others with the Other_ID_Continue property>
xid_start ::= <all characters in id_start whose NFKC normalization
is in "id_start xid_continue*">
xid_continue ::= <all characters in id_continue whose NFKC normalization
is in "id_continue*">
The Unicode category codes mentioned above stand for:
Lu - uppercase letters
Ll - lowercase letters
Lt - titlecase letters
Lm - modifier letters
Lo - other letters
Nl - letter numbers
Mn - nonspacing marks
Mc - spacing combining marks
Nd - decimal numbers
Pc - connector punctuations
Other_ID_Start - explicit list of characters in PropList.txt
to support backwards compatibility
Other_ID_Continue - likewise
+3
Python 3.x 문서의 모든 버전을 가리키면 대답은 yes입니다. 예 : http://docs.python.org/3.2/reference/lexical_analysis.html#identifiers –
+0
@JonClements D' oh! 편집 됨. –
관련 문제
- 1. 사용자 업로드/다운로드 파일 이름에 허용되는 문자
- 2. HTTP URL - 매개 변수 이름에 허용되는 문자
- 3. 파이썬 클래스 이름에 유효한 문자
- 4. Desire2Learn의 웹 서버를 통해 전달하는 동안 코스 이름에 허용되는 문자
- 5. Base64 encrypted 허용되는 문자
- 6. 파이썬 - 허용되는 변수 값
- 7. 파이썬 - 파일 이름에 공백이
- 8. Qt에서 Mac OS X, Windows 및 Linux의 파일 이름에 허용되는 일반 문자 및 문자 집합
- 9. Google ID에서 허용되는 문자 C2DM
- 10. python 파일 이름에 문자 추가
- 11. Clojure에서 허용되는 함수/매크로의 범위
- 12. 변수 이름에 문자 추가
- 13. Entity Framework : 엔터티 이름에 잘못된 문자 목록
- 14. 함수 내 함수 이름에 액세스하기
- 15. 파일 이름에 파이썬 문제가 발생했습니다
- 16. VC++의 함수/변수 이름에 영어 이외의 문자 사용?
- 17. 기호 이름에 파이썬 문자열
- 18. R의 rownames 또는 colnames에 허용되는 최대 문자 수는 있습니까?
- 19. 테이블 이름에 함수 사용
- 20. 'should'를 함수 이름에 사용하기
- 21. jshint 이름에 점이있는 함수
- 22. MATLAB에서 함수 이름에 사용할 수있는 ASCII 문자는 무엇입니까?
- 23. 경고 상자에 허용되는 문자 수 - 자바 스크립트
- 24. 문자열에서 허용되는 문자 수를 제한하는 TextBox
- 25. TextBox에서 허용되는 문자 제한 (금액 입력)
- 26. XML 속성에 허용되는 최대 문자 수는 얼마입니까?
- 27. 문자열에 허용되는 문자 만 포함되어 있는지 확인
- 28. 숫자, 문자 및 대시 만 허용되는 정규식?
- 29. 테이블 이름에 특수 문자 삽입
- 30. 파이썬 문자
하면 구글 : http://www.pasteur.fr/formation/infobio/python/ch02s03.html 파이썬에서 사용할 수있는 문자 [의 – BartoszKP
가능한 중복 클래스 이름] (http://stackoverflow.com/questions/10120295/valid-characters-in-a-python-class-name) – Ben
[변수 및 함수 이름에 대한 Python의 명명 규칙이란 무엇입니까?] http://stackoverflow.com/questions/159720/what-is-the-naming-convention-in-python-for-variable-and-function-names) – tecmec