TechNote.kr

  • 홈
  • 태그

delattr 1

Python - delattr(), object의 속성(attribute)을 제거하는 함수

delattr >>> delattr(object, name) object에 존재하는 속성을 제거한다. __builtin__ module에 포함된 function 이다. 예제에 앞서 delattr 예제를 위한 object를 다름과 같이 먼저 생성한다. >>> class sample: ... def __init__(self, x): ... self.x = x ... >>> >>> c = sample(1) >>> c.x 1 예제) 기존 속성을 제거하는 경우 >>> delattr(c, 'x') >>> getattr(c, 'x') Traceback (most recent call last): File "", line 1, in AttributeError: sample instance has no attribute..

Language/Python 2018.01.02
1
더보기
  • TechNote.
    • Language
      • C
      • R
      • Java
      • Python
      • Kotlin
      • HTML
      • Javascript
      • nvd3.js
      • Node.js
    • Android
    • OS
      • Windows
      • Linux
      • Mac
      • OpenWRT, LEDE
    • Network
      • Wi-Fi
    • Products & Services
      • Django
      • AmazonWebService (AWS)
      • VirtualBox
      • Adsense
      • WordPress
      • Tistory
      • VS Code
      • Docker
    • Database
    • Application
      • KidsTube
      • Notepad++
    • Computer architecture
    • Software architecture
    • ETC

최근글과 인기글

  • 최근글
  • 인기글
  • [Javascript] var, let, const 비교 분석 2022.07.03 23:43
  • [Javascript] 코드 동작 확인 방법 2022.06.20 00:01
  • [Node.js] 설치 및 버전 확인 2022.06.19 23:56
  • [VSCODE] Prettier - Code formatter 설정 2021.09.26 16:41
  • [Docker][해결방법] Got permission denied while trying to connect to the Do⋯ 2021.02.15 15:44
  • [04-5] Python - 파일 존재(isfile), 디렉토리 존재(isdir) 확인 방법 2017.01.07 15:46

Copyright © Kakao Corp. All rights reserved.

티스토리툴바