23 poin oleh xguru 2021-10-12 | 1 komentar | Bagikan ke WhatsApp
  • Tulisan yang disusun agar pembaca memahami Python dengan menjelaskan satu per satu objek bawaan yang ada di modul builtins

  • Apa itu aturan scope L.E.G.B.

  • dir(builtins)

→ 66 kelas Exception bawaan

→ 5 konstanta: True, False, None, Ellipsis, NotImplemented

→ Variabel global: spec, loader, debug, dll.

→ compile, exec, val: cara kerja kode

→ globals and locals: tempat semua hal disimpan

→ input and print: roti dan mentega

→ str, bytes, int, bool, float and complex: 5 primitive

→ object: dasar dari segalanya

→ type: pabrik kelas

→ hash and id: dasar dari equality

→ dir and vars: semua hal adalah dictionary

→ hasattr, getattr, setattr and delattr: pembantu atribut

→ super: kekuatan pewarisan

→ property, classmethod and staticmethod: dekorator metode

→ list, tuple, dict, set and frozenset: kontainer

→ bytearray and memoryview: antarmuka byte yang lebih baik

→ bin, hex, oct, ord, chr and ascii: konversi dasar

→ format: konversi teks yang mudah

→ any and all

→ abs, divmod, pow and round: dasar matematika

→ isinstance and issubclass: pengecekan tipe saat runtime

→ callable and duck typing basics

→ sorted and reversed: perubahan sekuens

→ map and filter: primitive fungsional

→ len, max, min and sum: fungsi agregat

→ iter and next: iterasi tingkat lanjut

→ range, enumerate and zip: iterasi yang praktis

→ slice

→ breakpoint: debugging bawaan

→ open: File I/O

→ repr: kemudahan bagi developer

→ help, exit and quit: site builtins

→ copyright, credits, license: site builtins lainnya

1 komentar

 
xguru 2021-10-12

Ini tulisan yang sangat unik, dengan penjelasan yang mudah dan rapi untuk memahami Python dari sisi internalnya.