├── .htaccess ├── examples ├── chinese.txt ├── plural4-rules.txt ├── plural5-rules.txt ├── beauregard.jpg ├── entry.pickle ├── favorite-people.txt ├── basic.json ├── oneline.py ├── basic-pretty.json ├── pickleversion.py ├── entry.json ├── stdout.py ├── plural6-rules.txt ├── .htaccess ├── regression.py ├── entry-pretty.json ├── fibonacci.py ├── fibonacci2.py ├── customserializer.py ├── plural1.py ├── roman1.py ├── plural4.py ├── plural3.py ├── plural5.py ├── roman3.py ├── roman2.py ├── plural2.py ├── roman4.py ├── alphameticstest.py ├── alphametics.py ├── humansize.py ├── roman5.py ├── plural6.py ├── feed.xml ├── feed-broken.xml ├── pluraltest1.py ├── pluraltest2.py ├── pluraltest3.py ├── pluraltest4.py ├── pluraltest5.py ├── feed-ns0.xml ├── roman10.py ├── roman6.py ├── roman7.py ├── roman8.py ├── roman9.py ├── romantest1.py ├── romantest2.py ├── romantest3.py ├── romantest4.py ├── romantest5.py ├── romantest6.py └── pluraltest6.py ├── robots.txt ├── .hgignore ├── i ├── .htaccess ├── cover.jpg ├── identica-deleted.png ├── identica-deleted.tiff ├── identica-screenshot.png ├── mac-pythonlauncher.png ├── mac-pythonlauncher.tiff ├── identica-screenshot.tiff ├── mac-install-1-welcome.png ├── mac-install-1-welcome.tiff ├── mac-install-3-license.png ├── mac-install-3-license.tiff ├── mac-install-8-progress.png ├── mac-interactive-shell.png ├── mac-interactive-shell.tiff ├── ubu-install-8-success.png ├── ubu-install-8-success.tiff ├── ubu-interactive-shell.png ├── ubu-interactive-shell.tiff ├── win-install-4-copying.png ├── win-install-4-copying.tiff ├── win-install-5-finish.png ├── win-install-5-finish.tiff ├── win-interactive-shell.png ├── win-interactive-shell.tiff ├── mac-install-8-progress.tiff ├── mac-install-9-succeeded.png ├── mac-install-9-succeeded.tiff ├── win-install-3-customize.png ├── win-install-3-customize.tiff ├── mac-install-0-dmg-contents.png ├── mac-install-0-dmg-contents.tiff ├── mac-install-2-information.png ├── mac-install-2-information.tiff ├── ubu-install-4-select-idle.png ├── ubu-install-4-select-idle.tiff ├── ubu-install-5-apply-changes.png ├── win-install-3a-disk-usage.png ├── win-install-3a-disk-usage.tiff ├── win-install-3b-test-suite.png ├── win-install-3b-test-suite.tiff ├── mac-install-4-license-dialog.png ├── mac-install-4-license-dialog.tiff ├── mac-install-6-custom-install.png ├── mac-install-6-custom-install.tiff ├── mac-install-7-admin-password.png ├── mac-install-7-admin-password.tiff ├── ubu-install-2-search-python-3.png ├── ubu-install-3-select-python-3.png ├── ubu-install-5-apply-changes.tiff ├── mac-install-5-standard-install.png ├── mac-install-5-standard-install.tiff ├── ubu-install-2-search-python-3.tiff ├── ubu-install-3-select-python-3.tiff ├── ubu-install-6-download-progress.png ├── ubu-install-6-download-progress.tiff ├── ubu-install-7-install-progress.png ├── ubu-install-7-install-progress.tiff ├── win-install-0-security-warning.png ├── win-install-0-security-warning.tiff ├── mac-install-10-application-folder.png ├── mac-install-10-application-folder.tiff ├── ubu-install-0-add-remove-programs.png ├── ubu-install-0-add-remove-programs.tiff ├── win-install-1-all-users-or-just-me.png ├── win-install-1-all-users-or-just-me.tiff ├── win-install-2-destination-directory.png ├── win-install-2-destination-directory.tiff ├── openclipart.org_media_files_Selanit_8331.png ├── openclipart.org_media_files_Selanit_8331.tiff ├── ubu-install-1-all-open-source-applications.png ├── ubu-install-1-all-open-source-applications.tiff ├── openclipart.org_media_files_johnny_automatic_5154.png ├── openclipart.org_media_files_johnny_automatic_5261.png ├── openclipart.org_media_files_johnny_automatic_5154.tiff └── openclipart.org_media_files_johnny_automatic_5261.tiff ├── j ├── .htaccess ├── ga.js ├── plug.html └── html5.js ├── util ├── compiler.jar ├── yuicompressor-2.4.2.jar ├── single-footer.html ├── single-header2.html ├── single-header.html ├── validate.py ├── lesscss.py ├── buildtoc.py ├── htmlminimizer.py └── flatten.py ├── images-original ├── mac-pythonlauncher.png ├── win-install-5-finish.bmp ├── mac-install-1-welcome.png ├── mac-install-3-license.png ├── mac-install-8-progress.png ├── mac-install-9-succeeded.png ├── mac-interactive-shell.png ├── ubu-install-8-success.png ├── ubu-interactive-shell.png ├── win-install-3-customize.bmp ├── win-install-4-copying.bmp ├── win-interactive-shell.bmp ├── mac-install-2-information.png ├── ubu-install-4-select-idle.png ├── win-install-3a-disk-usage.bmp ├── win-install-3b-test-suite.bmp ├── mac-install-0-dmg-contents.png ├── mac-install-4-license-dialog.png ├── mac-install-6-custom-install.png ├── mac-install-7-admin-password.png ├── ubu-install-5-apply-changes.png ├── mac-install-5-standard-install.png ├── ubu-install-2-search-python-3.png ├── ubu-install-3-select-python-3.png ├── ubu-install-7-install-progress.png ├── win-install-0-security-warning.bmp ├── mac-install-10-application-folder.png ├── ubu-install-0-add-remove-programs.png ├── ubu-install-6-download-progress.png ├── win-install-1-all-users-or-just-me.bmp ├── win-install-2-destination-directory.bmp └── ubu-install-1-all-open-source-applications.png ├── README.md ├── blank.html ├── notes.txt ├── diveintopython3.org ├── prince.css ├── layout.css ├── about.html ├── mobile.css ├── print.css ├── index.html ├── troubleshooting.html ├── colophon.html ├── whats-new.html └── where-to-go-from-here.html /.htaccess: -------------------------------------------------------------------------------- 1 | FileETag MTime Size 2 | 3 | SetEnv dont-vary 4 | -------------------------------------------------------------------------------- /examples/chinese.txt: -------------------------------------------------------------------------------- 1 | Dive Into Python 是为有经验的程序员编写的一本 Python 书。 2 | -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | User-Agent: * 2 | Disallow: /tmp/ 3 | Disallow: /d/ 4 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | *.pyc 3 | build 4 | grid28.gif 5 | copyedit 6 | proofs 7 | -------------------------------------------------------------------------------- /i/.htaccess: -------------------------------------------------------------------------------- 1 | FileETag MTime Size 2 | 3 | ExpiresActive On 4 | ExpiresDefault "access plus 1 year" 5 | -------------------------------------------------------------------------------- /i/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/cover.jpg -------------------------------------------------------------------------------- /j/.htaccess: -------------------------------------------------------------------------------- 1 | FileETag MTime Size 2 | 3 | ExpiresActive On 4 | ExpiresDefault "access plus 1 year" 5 | -------------------------------------------------------------------------------- /examples/plural4-rules.txt: -------------------------------------------------------------------------------- 1 | [sxz]$ $ es 2 | [^aeioudgkprt]h$ $ es 3 | [^aeiou]y$ y$ ies 4 | $ $ s 5 | -------------------------------------------------------------------------------- /examples/plural5-rules.txt: -------------------------------------------------------------------------------- 1 | [sxz]$ $ es 2 | [^aeioudgkprt]h$ $ es 3 | [^aeiou]y$ y$ ies 4 | $ $ s 5 | -------------------------------------------------------------------------------- /util/compiler.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/util/compiler.jar -------------------------------------------------------------------------------- /examples/beauregard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/examples/beauregard.jpg -------------------------------------------------------------------------------- /examples/entry.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/examples/entry.pickle -------------------------------------------------------------------------------- /i/identica-deleted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/identica-deleted.png -------------------------------------------------------------------------------- /i/identica-deleted.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/identica-deleted.tiff -------------------------------------------------------------------------------- /i/identica-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/identica-screenshot.png -------------------------------------------------------------------------------- /i/mac-pythonlauncher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-pythonlauncher.png -------------------------------------------------------------------------------- /i/mac-pythonlauncher.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-pythonlauncher.tiff -------------------------------------------------------------------------------- /i/identica-screenshot.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/identica-screenshot.tiff -------------------------------------------------------------------------------- /i/mac-install-1-welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-1-welcome.png -------------------------------------------------------------------------------- /i/mac-install-1-welcome.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-1-welcome.tiff -------------------------------------------------------------------------------- /i/mac-install-3-license.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-3-license.png -------------------------------------------------------------------------------- /i/mac-install-3-license.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-3-license.tiff -------------------------------------------------------------------------------- /i/mac-install-8-progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-8-progress.png -------------------------------------------------------------------------------- /i/mac-interactive-shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-interactive-shell.png -------------------------------------------------------------------------------- /i/mac-interactive-shell.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-interactive-shell.tiff -------------------------------------------------------------------------------- /i/ubu-install-8-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-8-success.png -------------------------------------------------------------------------------- /i/ubu-install-8-success.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-8-success.tiff -------------------------------------------------------------------------------- /i/ubu-interactive-shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-interactive-shell.png -------------------------------------------------------------------------------- /i/ubu-interactive-shell.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-interactive-shell.tiff -------------------------------------------------------------------------------- /i/win-install-4-copying.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-4-copying.png -------------------------------------------------------------------------------- /i/win-install-4-copying.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-4-copying.tiff -------------------------------------------------------------------------------- /i/win-install-5-finish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-5-finish.png -------------------------------------------------------------------------------- /i/win-install-5-finish.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-5-finish.tiff -------------------------------------------------------------------------------- /i/win-interactive-shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-interactive-shell.png -------------------------------------------------------------------------------- /i/win-interactive-shell.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-interactive-shell.tiff -------------------------------------------------------------------------------- /util/yuicompressor-2.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/util/yuicompressor-2.4.2.jar -------------------------------------------------------------------------------- /examples/favorite-people.txt: -------------------------------------------------------------------------------- 1 | Dora 2 | Ethan 3 | Wesley 4 | John 5 | Anne 6 | Mike 7 | Chris 8 | Sarah 9 | Alex 10 | Lizzie 11 | -------------------------------------------------------------------------------- /i/mac-install-8-progress.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-8-progress.tiff -------------------------------------------------------------------------------- /i/mac-install-9-succeeded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-9-succeeded.png -------------------------------------------------------------------------------- /i/mac-install-9-succeeded.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-9-succeeded.tiff -------------------------------------------------------------------------------- /i/win-install-3-customize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-3-customize.png -------------------------------------------------------------------------------- /i/win-install-3-customize.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-3-customize.tiff -------------------------------------------------------------------------------- /i/mac-install-0-dmg-contents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-0-dmg-contents.png -------------------------------------------------------------------------------- /i/mac-install-0-dmg-contents.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-0-dmg-contents.tiff -------------------------------------------------------------------------------- /i/mac-install-2-information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-2-information.png -------------------------------------------------------------------------------- /i/mac-install-2-information.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-2-information.tiff -------------------------------------------------------------------------------- /i/ubu-install-4-select-idle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-4-select-idle.png -------------------------------------------------------------------------------- /i/ubu-install-4-select-idle.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-4-select-idle.tiff -------------------------------------------------------------------------------- /i/ubu-install-5-apply-changes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-5-apply-changes.png -------------------------------------------------------------------------------- /i/win-install-3a-disk-usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-3a-disk-usage.png -------------------------------------------------------------------------------- /i/win-install-3a-disk-usage.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-3a-disk-usage.tiff -------------------------------------------------------------------------------- /i/win-install-3b-test-suite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-3b-test-suite.png -------------------------------------------------------------------------------- /i/win-install-3b-test-suite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-3b-test-suite.tiff -------------------------------------------------------------------------------- /i/mac-install-4-license-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-4-license-dialog.png -------------------------------------------------------------------------------- /i/mac-install-4-license-dialog.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-4-license-dialog.tiff -------------------------------------------------------------------------------- /i/mac-install-6-custom-install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-6-custom-install.png -------------------------------------------------------------------------------- /i/mac-install-6-custom-install.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-6-custom-install.tiff -------------------------------------------------------------------------------- /i/mac-install-7-admin-password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-7-admin-password.png -------------------------------------------------------------------------------- /i/mac-install-7-admin-password.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-7-admin-password.tiff -------------------------------------------------------------------------------- /i/ubu-install-2-search-python-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-2-search-python-3.png -------------------------------------------------------------------------------- /i/ubu-install-3-select-python-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-3-select-python-3.png -------------------------------------------------------------------------------- /i/ubu-install-5-apply-changes.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-5-apply-changes.tiff -------------------------------------------------------------------------------- /util/single-footer.html: -------------------------------------------------------------------------------- 1 |

© 2001–9 Mark Pilgrim 2 | 3 | 4 | -------------------------------------------------------------------------------- /i/mac-install-5-standard-install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-5-standard-install.png -------------------------------------------------------------------------------- /i/mac-install-5-standard-install.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-5-standard-install.tiff -------------------------------------------------------------------------------- /i/ubu-install-2-search-python-3.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-2-search-python-3.tiff -------------------------------------------------------------------------------- /i/ubu-install-3-select-python-3.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-3-select-python-3.tiff -------------------------------------------------------------------------------- /i/ubu-install-6-download-progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-6-download-progress.png -------------------------------------------------------------------------------- /i/ubu-install-6-download-progress.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-6-download-progress.tiff -------------------------------------------------------------------------------- /i/ubu-install-7-install-progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-7-install-progress.png -------------------------------------------------------------------------------- /i/ubu-install-7-install-progress.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-7-install-progress.tiff -------------------------------------------------------------------------------- /i/win-install-0-security-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-0-security-warning.png -------------------------------------------------------------------------------- /i/win-install-0-security-warning.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-0-security-warning.tiff -------------------------------------------------------------------------------- /images-original/mac-pythonlauncher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-pythonlauncher.png -------------------------------------------------------------------------------- /i/mac-install-10-application-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-10-application-folder.png -------------------------------------------------------------------------------- /i/mac-install-10-application-folder.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/mac-install-10-application-folder.tiff -------------------------------------------------------------------------------- /i/ubu-install-0-add-remove-programs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-0-add-remove-programs.png -------------------------------------------------------------------------------- /i/ubu-install-0-add-remove-programs.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-0-add-remove-programs.tiff -------------------------------------------------------------------------------- /i/win-install-1-all-users-or-just-me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-1-all-users-or-just-me.png -------------------------------------------------------------------------------- /images-original/win-install-5-finish.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/win-install-5-finish.bmp -------------------------------------------------------------------------------- /examples/basic.json: -------------------------------------------------------------------------------- 1 | {"published": true, "tags": ["diveintopython", "docbook", "html"], "comments_link": null, "id": 256, "title": "Dive into history, 2009 edition"} -------------------------------------------------------------------------------- /i/win-install-1-all-users-or-just-me.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-1-all-users-or-just-me.tiff -------------------------------------------------------------------------------- /i/win-install-2-destination-directory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-2-destination-directory.png -------------------------------------------------------------------------------- /i/win-install-2-destination-directory.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/win-install-2-destination-directory.tiff -------------------------------------------------------------------------------- /images-original/mac-install-1-welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-install-1-welcome.png -------------------------------------------------------------------------------- /images-original/mac-install-3-license.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-install-3-license.png -------------------------------------------------------------------------------- /images-original/mac-install-8-progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-install-8-progress.png -------------------------------------------------------------------------------- /images-original/mac-install-9-succeeded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-install-9-succeeded.png -------------------------------------------------------------------------------- /images-original/mac-interactive-shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-interactive-shell.png -------------------------------------------------------------------------------- /images-original/ubu-install-8-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/ubu-install-8-success.png -------------------------------------------------------------------------------- /images-original/ubu-interactive-shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/ubu-interactive-shell.png -------------------------------------------------------------------------------- /images-original/win-install-3-customize.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/win-install-3-customize.bmp -------------------------------------------------------------------------------- /images-original/win-install-4-copying.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/win-install-4-copying.bmp -------------------------------------------------------------------------------- /images-original/win-interactive-shell.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/win-interactive-shell.bmp -------------------------------------------------------------------------------- /images-original/mac-install-2-information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-install-2-information.png -------------------------------------------------------------------------------- /images-original/ubu-install-4-select-idle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/ubu-install-4-select-idle.png -------------------------------------------------------------------------------- /images-original/win-install-3a-disk-usage.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/win-install-3a-disk-usage.bmp -------------------------------------------------------------------------------- /images-original/win-install-3b-test-suite.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/win-install-3b-test-suite.bmp -------------------------------------------------------------------------------- /i/openclipart.org_media_files_Selanit_8331.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/openclipart.org_media_files_Selanit_8331.png -------------------------------------------------------------------------------- /i/openclipart.org_media_files_Selanit_8331.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/openclipart.org_media_files_Selanit_8331.tiff -------------------------------------------------------------------------------- /i/ubu-install-1-all-open-source-applications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-1-all-open-source-applications.png -------------------------------------------------------------------------------- /images-original/mac-install-0-dmg-contents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-install-0-dmg-contents.png -------------------------------------------------------------------------------- /images-original/mac-install-4-license-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-install-4-license-dialog.png -------------------------------------------------------------------------------- /images-original/mac-install-6-custom-install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-install-6-custom-install.png -------------------------------------------------------------------------------- /images-original/mac-install-7-admin-password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-install-7-admin-password.png -------------------------------------------------------------------------------- /images-original/ubu-install-5-apply-changes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/ubu-install-5-apply-changes.png -------------------------------------------------------------------------------- /i/ubu-install-1-all-open-source-applications.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/ubu-install-1-all-open-source-applications.tiff -------------------------------------------------------------------------------- /images-original/mac-install-5-standard-install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-install-5-standard-install.png -------------------------------------------------------------------------------- /images-original/ubu-install-2-search-python-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/ubu-install-2-search-python-3.png -------------------------------------------------------------------------------- /images-original/ubu-install-3-select-python-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/ubu-install-3-select-python-3.png -------------------------------------------------------------------------------- /images-original/ubu-install-7-install-progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/ubu-install-7-install-progress.png -------------------------------------------------------------------------------- /images-original/win-install-0-security-warning.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/win-install-0-security-warning.bmp -------------------------------------------------------------------------------- /images-original/mac-install-10-application-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/mac-install-10-application-folder.png -------------------------------------------------------------------------------- /images-original/ubu-install-0-add-remove-programs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/ubu-install-0-add-remove-programs.png -------------------------------------------------------------------------------- /images-original/ubu-install-6-download-progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/ubu-install-6-download-progress.png -------------------------------------------------------------------------------- /i/openclipart.org_media_files_johnny_automatic_5154.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/openclipart.org_media_files_johnny_automatic_5154.png -------------------------------------------------------------------------------- /i/openclipart.org_media_files_johnny_automatic_5261.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/openclipart.org_media_files_johnny_automatic_5261.png -------------------------------------------------------------------------------- /images-original/win-install-1-all-users-or-just-me.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/win-install-1-all-users-or-just-me.bmp -------------------------------------------------------------------------------- /images-original/win-install-2-destination-directory.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/win-install-2-destination-directory.bmp -------------------------------------------------------------------------------- /i/openclipart.org_media_files_johnny_automatic_5154.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/openclipart.org_media_files_johnny_automatic_5154.tiff -------------------------------------------------------------------------------- /i/openclipart.org_media_files_johnny_automatic_5261.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/i/openclipart.org_media_files_johnny_automatic_5261.tiff -------------------------------------------------------------------------------- /util/single-header2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /images-original/ubu-install-1-all-open-source-applications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juehan/DiveIntoPython3_Korean_Translation/HEAD/images-original/ubu-install-1-all-open-source-applications.png -------------------------------------------------------------------------------- /examples/oneline.py: -------------------------------------------------------------------------------- 1 | line_number = 1 2 | with open('examples/favorite-people.txt', encoding='utf-8') as a_file: 3 | for a_line in a_file: 4 | print('{:>4} {}'.format(line_number, a_line.rstrip())) 5 | line_number += 1 6 | -------------------------------------------------------------------------------- /examples/basic-pretty.json: -------------------------------------------------------------------------------- 1 | { 2 | "published": true, 3 | "tags": [ 4 | "diveintopython", 5 | "docbook", 6 | "html" 7 | ], 8 | "comments_link": null, 9 | "id": 256, 10 | "title": "Dive into history, 2009 edition" 11 | } -------------------------------------------------------------------------------- /j/ga.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/pickleversion.py: -------------------------------------------------------------------------------- 1 | import pickletools 2 | 3 | def protocol_version(file_object): 4 | maxproto = -1 5 | for opcode, arg, pos in pickletools.genops(file_object): 6 | maxproto = max(maxproto, opcode.proto) 7 | return maxproto 8 | 9 | -------------------------------------------------------------------------------- /j/plug.html: -------------------------------------------------------------------------------- 1 |

Also available on dead trees!
Dive Into Python 3
2 | -------------------------------------------------------------------------------- /examples/entry.json: -------------------------------------------------------------------------------- 1 | {"published_date": {"__class__": "time.asctime", "__value__": "Fri Mar 27 22:20:42 2009"}, "comments_link": null, "internal_id": {"__class__": "bytes", "__value__": [222, 213, 180, 248]}, "tags": ["diveintopython", "docbook", "html"], "title": "Dive into history, 2009 edition", "article_link": "http://diveintomark.org/archives/2009/03/27/dive-into-history-2009-edition", "published": true} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Dive Into Python 3 한국어 번역 프로젝트 2 | 3 | 마크 필그램의 Open Book 인 Dive Into Python 3 를 한국어로 번역하기 위한 페이지 입니다. 4 | 이 한국어 번역 프로젝트는 최초 [여기](https://github.com/kybin/translateDiveIntoPython3korean)에서 출발하였습니다. 5 | 6 | ## 진행상황 및 번역 결과물 7 | 8 | 프로젝트 진행상황과 결과물은 [이곳](http://juehan.github.com/DiveIntoPython3_Korean_Translation/)을 통해 확인할 수 있습니다. 9 | 10 | ## 피드백 11 | 12 | 상업적인 목적을 가지고 진행하는 것이 아닌 만큼, 번역의 질이 전문 번역자가 한 그것에 비해 떨어질 수 밖에 없습니다. 관심있는 모든 분들의 피드백을 환영합니다. -------------------------------------------------------------------------------- /examples/stdout.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | class RedirectStdoutTo: 4 | def __init__(self, out_new): 5 | self.out_new = out_new 6 | 7 | def __enter__(self): 8 | self.out_old = sys.stdout 9 | sys.stdout = self.out_new 10 | 11 | def __exit__(self, *args): 12 | sys.stdout = self.out_old 13 | 14 | print('A') 15 | with open('out.log', mode='w', encoding='utf-8') as a_file, RedirectStdoutTo(a_file): 16 | print('B') 17 | print('C') 18 | -------------------------------------------------------------------------------- /examples/plural6-rules.txt: -------------------------------------------------------------------------------- 1 | ^(sheep|deer|fish|moose|aircraft|series|haiku)$ ($) \1 2 | [ml]ouse$ ouse$ ice 3 | child$ $ ren 4 | booth$ $ s 5 | foot$ oot$ eet 6 | ooth$ ooth$ eeth 7 | l[eo]af$ af$ aves 8 | sis$ sis$ ses 9 | ^(hu|ro)man$ $ s 10 | man$ man$ men 11 | ^lowlife$ $ s 12 | ife$ ife$ ives 13 | eau$ $ x 14 | ^[dp]elf$ $ s 15 | lf$ lf$ lves 16 | [sxz]$ $ es 17 | [^aeioudgkprt]h$ $ es 18 | (qu|[^aeiou])y$ y$ ies 19 | $ $ s 20 | -------------------------------------------------------------------------------- /examples/.htaccess: -------------------------------------------------------------------------------- 1 | AddType application/xml .xml 2 | AddType text/plain .py 3 | 4 | AddDefaultCharset utf-8 5 | 6 | ExpiresActive On 7 | ExpiresDefault "access plus 1 day" 8 | 9 | FileETag MTime Size 10 | 11 | SetOutputFilter DEFLATE 12 | 13 | Header unset Vary 14 | Header add Vary Accept-Encoding 15 | 16 | Redirect /examples/feed-302.xml http://diveintopython3.org/examples/feed.xml 17 | Redirect permanent /examples/feed-301.xml http://diveintopython3.org/examples/feed.xml 18 | -------------------------------------------------------------------------------- /blank.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This page intentionally left blank - Dive Into Python 3 5 | 6 | 9 | 10 | 11 | 12 |

This page intentionally left blank. 13 | -------------------------------------------------------------------------------- /examples/regression.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import unittest 4 | import os 5 | import glob 6 | 7 | def regressionTest(): 8 | filenames = glob.glob('*test*.py') 9 | module_names = [os.path.splitext(os.path.basename(f))[0] for f in filenames] 10 | modules = [__import__(name) for name in module_names] 11 | tests = [unittest.defaultTestLoader.loadTestsFromModule(m) for m in modules] 12 | return unittest.TestSuite(tests) 13 | 14 | if __name__ == '__main__': 15 | unittest.main(defaultTest='regressionTest') -------------------------------------------------------------------------------- /util/single-header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Dive Into Python 3 6 | 7 | 8 | 9 | 10 | 11 | 15 | -------------------------------------------------------------------------------- /examples/entry-pretty.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments_link": null, 3 | "internal_id": { 4 | "__class__": "bytes", 5 | "__value__": [ 6 | 222, 7 | 213, 8 | 180, 9 | 248 10 | ] 11 | }, 12 | "title": "Dive into history, 2009 edition", 13 | "tags": [ 14 | "diveintopython", 15 | "docbook", 16 | "html" 17 | ], 18 | "article_link": "http://diveintomark.org/archives/2009/03/27/dive-into-history-2009-edition", 19 | "published_date": { 20 | "__class__": "time.asctime", 21 | "__value__": "Fri Mar 27 22:20:42 2009" 22 | }, 23 | "published": true 24 | } -------------------------------------------------------------------------------- /util/validate.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | try: 4 | import html5lib 5 | except ImportError: 6 | sys.path.insert(0, '/home/pilgrim/code/html5lib/python3/src/') 7 | import html5lib 8 | 9 | input_filename = sys.argv[1] 10 | parser = html5lib.HTMLParser() 11 | with open(input_filename, encoding='utf-8') as stream: 12 | data = stream.read() 13 | html5doc = parser.parse(data, encoding='utf-8') 14 | if parser.errors: 15 | for ((line, column), errtype, params) in parser.errors: 16 | print("Error: {} {} on line {} of {}".format(errtype, repr(params), line, input_filename), file=sys.stderr) 17 | sys.exit(1) 18 | 19 | -------------------------------------------------------------------------------- /j/html5.js: -------------------------------------------------------------------------------- 1 | /*@cc_on@if(@_jscript_version<9)(function(p,e){function q(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var c=r[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;q(a,b)}}function s(a,b){for(var c=new RegExp("\\b("+m+")\\b(?!.*[;}])","gi"),d=function(k){return".iepp_"+k},h=-1;++h\\s*$","i");i.innerHTML=a.outerHTML.replace(/\r|\n/g," ").replace(c,a.currentStyle.display=="block"?"":"");c=i.childNodes[0];c.className+=" iepp_"+d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[0])}s(e.styleSheets,"all")}function u(){for(var a=-1,b;++a 76 | 77 | -------------------------------------------------------------------------------- /colophon.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Colophon - Dive Into Python 3 5 | 6 | 10 | 11 | 12 | 13 |

  
14 |

You are here: Home Dive Into Python 3 15 |

Colophon

16 |
17 |

Je n’ai fait celle-ci plus longue que parce que je n’ai pas eu le loisir de la faire plus courte.
(I would have written a shorter letter, but I did not have the time.)
Blaise Pascal 18 |

19 |

  20 |

Diving In

21 |

This book, like all books, was a labor of love. Oh sure, I got paid the medium-sized bucks for it, but nobody writes technical books for the money. And since this book is available on the web as well as on paper, I spent a lot of time fiddling with webby stuff when I should have been writing. 22 | 23 |

[typewriter] 24 | 25 |

The online edition loads as efficiently as possible. Efficiency never happens by accident; I spent many hours making it so. Perhaps too many hours. Yes, almost certainly too many hours. Never underestimate the depths to which a procrastinating writer will sink. 26 | 27 |

I won’t bore you with all the details. Wait, yes — I will bore you with all the details. But here’s the short version. 28 | 29 |

    30 |
  1. HTML is minimized, then served compressed. 31 |
  2. Scripts and stylesheets are minimized by YUI Compressor (and also served compressed). 32 |
  3. Scripts are combined to reduce HTTP requests. 33 |
  4. Stylesheets are combined and inlined to reduce HTTP requests. 34 |
  5. Unused CSS selectors and properties are removed on a page-by-page basis with a little help from pyquery. 35 |
  6. HTTP caching and other server-side options are optimized based on advice from YSlow and Page Speed. 36 |
  7. Pages use Unicode characters in place of images wherever possible. 37 |
  8. Images are optimized with OptiPNG. 38 |
  9. The entire book was lovingly hand-authored in HTML 5 to avoid markup cruft. 39 |
40 | 41 |

⁂ 42 | 43 |

Typography

44 | 45 |

vertical rhythm, best available ampersand, curly quotes/apostrophes, other stuff from webtypography.net 46 | 47 |

⁂ 48 | 49 |

Graphics

50 | 51 |

Unicode, callouts, font-family issues on Windows 52 | 53 |

⁂ 54 | 55 |

Performance

56 | 57 |

"Dive Into History 2009 edition", minimizing CSS + JS + HTML, inline CSS, optimizing images 58 | 59 |

⁂ 60 | 61 |

Fun stuff

62 | 63 |

Quotes, constrained writing(?), PapayaWhip 64 | 65 |

⁂ 66 | 67 |

Further Reading

68 | 69 | 83 | 84 |

© 2001–11 Mark Pilgrim 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /whats-new.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 파이썬3로 뛰어들기의 새로운 점 4 | 5 | 6 | 10 | 11 | 12 | 13 |

  
14 |

여기 있어요 : Home Dive Into Python 3 15 | 16 |

“파이썬3로 뛰어들기”의 새로운 점

17 |
18 |

여기가 들어왔던 곳이 맞나?
— 핑크 플로이드, The Wall 19 |

20 |

  21 |

준비 레벨

22 | 23 |

자, 시작하기 전에 질문을 몇 개 드릴테니 대답해 보세요. 첫째, 이 글을 읽고 계신 여러분은 파이썬 프로그래머인가요 ? 둘째, 제가 예전에 작성했던 파이썬으로 뛰어들기 (Dive Into Python) 라는 책을 읽었나요 ? 셋째, 만약 읽었다면 책으로 읽었나요? (그렇다면, 감사합니다 ^^) 마지막으로, 어찌됬던간에 파이썬 3 를 공부할 준비를 마쳤나요 ? 지금까지 제가 드린 질문에 전부 yes 라고 대답하셨다면, 이 장을 계속 읽어 나가셔도 됩니다. 하지만, 만약 여러분이 전부 no 라고 대답하셨다면, 여기에서 시작하세요. 24 | 25 |

26 | 파이썬 3를 설치하면 2to3라는 작은 어플리케이션도 함께 설치되는데요, 이 프로그램을 이용하면 파이썬 2 소스 코드를 파이썬 3 소스코드로 자동으로 변경시킬 수 있습니다. 27 | 2to3로 파이썬3 포팅하기라는 부록도 따로 빼서 준비했으니까 나중에 꼭 한번 읽어보시기 바랍니다. 28 | 29 | 2to3 툴이 파이썬 2 코드에서 파이썬 3 코드로 자동으로 변경해줄 수 있는 부분이란 문법의 변경이 대부분이기 때문에, 이 툴을 이용하다보면 파이썬3에서 변경된 문법을 자연스럽게 배울 수 있습니다. (예를 들어, 파이썬 3에서는 print는 더이상 구문이 아닌 함수이기 때문에, print x로 쓰면 안되고 print(x)로 써야 합니다.) 30 | 31 |

사례 연구: chardet 파이썬 3로 포팅하기 에서는 파이썬 2에서 파이썬 3로 포팅하면서 겪었던 저만의 경험담을 적어 봤습니다. (결국엔 해냈습니다. ^^). 제 작은 경험담이 여러분께 도움이 될 수도, 아닐 수도 있을텐데요. 어쨌건 여러분께서는 많은 걸 배워야 할 겁니다. 우선은 라이브러리가 어떻게 변경되었는지를 이해해야 합니다. 그래야 포팅하면서 발생하는 에러들과 제가 그걸 어떻게 고쳤는지 이해할 수 있으니까요. 사실 많은 문제들은 문자열 쪽에서 생긴거였어요. 32 | 33 |

문자열이라, 휴, 어디서부터 시작해야 할지 막막하네요. 파이썬 2에는 문자열(string)과 유니코드 문자열(unicode string)이 있었죠. 파이썬 3에는 바이트(byte)와 문자열(string)이 있습니다. 파이썬 3에서 모든 문자열은 유니코드 입니다. 그러니까 진짜 바이트를 다루고 싶으면 파이썬 3에서 새로 도입한 byte 타입을 사용하세요. 파이썬 3는 문자열(string)과 바이트(byte) 간의 묵시적 형 변환을 허용하지 않기 때문에, 여러분이 이 둘의 차이을 정확히 이해하지 못하고, 언제 무엇을 써야 할지 모른다면, 그 코드는 마치 시한폭탄을 안고 있는거나 마찬가지입니다.언젠가는 반드시 문제가 생길겁니다. 자세한 이야기는 문자열 장에서 계속하죠. 34 | 35 |

바이트와 문자열은 워낙 광범위하게 적용되는 내용이라, 이 책 전반에 걸쳐 계속 등장할 겁니다. 몇가지 예를 들면 아래와 같습니다. 36 | 37 |

47 | 48 |

여러분이 지금 당장은 유니코드에 관심이 없다고 하더라도 (안됬지만, 나중엔 어쩔 수 없이 봐야 할겁니다), 파이썬 3에서의 문자열 포맷팅에 대해서는 궁금하셨을겁니다. 왜냐하면, 파이썬 2에서와는 완전히 달라진 새로운 문자열 포맷팅이기 때문이죠. 반드시 읽어보셔야 합니다. 49 | 50 |

반복자(iterator)는 파이썬 3 전반에 걸쳐 사용됬습니다. 솔직히 말해, 저 자신도 이전에는 잘 몰랐던 걸 이번 기회에 많이 알게 되었습니다. 제가 파이썬에 뛰어들기라는 책을 처음으로 썼던 5년 전보다 198 프로 정도 이해가 깊어졌다고나 할까요. 여러분도 저처럼 반복자에 대한 이해가 깊어졌으면 좋겠습니다. 파이썬 2에서 리스트를 반환하던 많은 함수들이, 파이썬 3에서는 반복자를 반환하는 것으로 변경되었습니다. 아무리 귀찮더라도, 반복자 챕터의 뒷쪽 절반이랑 고급 반복자 챕터의 뒷부분 절반은 반드시 읽어보셔야 합니다. 51 | 52 |

여러분의 열화와 같은 성원 덕분에, 특별한 메소드 이름을 부록으로 첨부했습니다, 파이썬 공식문서인 “데이터 모델”과 비슷하지만, 나름 좀 더 자세히 파헤쳐 봤습니다. 53 | 54 |

제가 맨 처음 파이썬에 뛰어들기란 책을 썼던 때만 하더라도, 파이썬 XML 라이브러리 중 쓸만한 게 정말 거의 없었습니다. 디행히도 나중에 Fredrik 과 Lundh라는 분들이 ElementTree라는 꽤 괜찮은 XML 라이브러리를 만들었죠. 파이썬 위원회에서도 이 라이브러리가 마음에 들었던지 파이썬 표준 라이브러리에 포함시켰습니다. 이 책 후반부의 새로운 XML이라는 챕터는 ElementTree 라이브러리를 토대로 작성되었습니다. 예전 방식대로 XML을 파싱할 수도 있겠지만, 그렇게 하지 마세요. 별로 안좋습니다. 55 | 56 |

언어 자체의 변화가 아니라, 파이썬 커뮤니티의 변화로는 The Python Package Index (PyPI) 가 유명해진 점을 꼽을 수 있습니다. 파이썬 3에서는 여러분이 PyPI로 코드를 패키징하고 배포하는 절차를 간단하게 할 수 있도록 작은 유틸리티도 함께 제공합니다. 자세한 정보는 파이썬 라이브러리 패키징하기 챕터를 읽어 보세요. 57 | 58 |

© 2001–11 Mark Pilgrim 59 | -------------------------------------------------------------------------------- /examples/romantest5.py: -------------------------------------------------------------------------------- 1 | '''Unit test for roman1.py 2 | 3 | This program is part of 'Dive Into Python 3', a free Python book for 4 | experienced programmers. Visit http://diveintopython3.org/ for the 5 | latest version. 6 | ''' 7 | 8 | import roman5 9 | import unittest 10 | 11 | class KnownValues(unittest.TestCase): 12 | known_values = ( (1, 'I'), 13 | (2, 'II'), 14 | (3, 'III'), 15 | (4, 'IV'), 16 | (5, 'V'), 17 | (6, 'VI'), 18 | (7, 'VII'), 19 | (8, 'VIII'), 20 | (9, 'IX'), 21 | (10, 'X'), 22 | (50, 'L'), 23 | (100, 'C'), 24 | (500, 'D'), 25 | (1000, 'M'), 26 | (31, 'XXXI'), 27 | (148, 'CXLVIII'), 28 | (294, 'CCXCIV'), 29 | (312, 'CCCXII'), 30 | (421, 'CDXXI'), 31 | (528, 'DXXVIII'), 32 | (621, 'DCXXI'), 33 | (782, 'DCCLXXXII'), 34 | (870, 'DCCCLXX'), 35 | (941, 'CMXLI'), 36 | (1043, 'MXLIII'), 37 | (1110, 'MCX'), 38 | (1226, 'MCCXXVI'), 39 | (1301, 'MCCCI'), 40 | (1485, 'MCDLXXXV'), 41 | (1509, 'MDIX'), 42 | (1607, 'MDCVII'), 43 | (1754, 'MDCCLIV'), 44 | (1832, 'MDCCCXXXII'), 45 | (1993, 'MCMXCIII'), 46 | (2074, 'MMLXXIV'), 47 | (2152, 'MMCLII'), 48 | (2212, 'MMCCXII'), 49 | (2343, 'MMCCCXLIII'), 50 | (2499, 'MMCDXCIX'), 51 | (2574, 'MMDLXXIV'), 52 | (2646, 'MMDCXLVI'), 53 | (2723, 'MMDCCXXIII'), 54 | (2892, 'MMDCCCXCII'), 55 | (2975, 'MMCMLXXV'), 56 | (3051, 'MMMLI'), 57 | (3185, 'MMMCLXXXV'), 58 | (3250, 'MMMCCL'), 59 | (3313, 'MMMCCCXIII'), 60 | (3408, 'MMMCDVIII'), 61 | (3501, 'MMMDI'), 62 | (3610, 'MMMDCX'), 63 | (3743, 'MMMDCCXLIII'), 64 | (3844, 'MMMDCCCXLIV'), 65 | (3888, 'MMMDCCCLXXXVIII'), 66 | (3940, 'MMMCMXL'), 67 | (3999, 'MMMCMXCIX')) 68 | 69 | def test_to_roman_known_values(self): 70 | '''to_roman should give known result with known input''' 71 | for integer, numeral in self.known_values: 72 | result = roman5.to_roman(integer) 73 | self.assertEqual(numeral, result) 74 | 75 | def test_from_roman_known_values(self): 76 | '''from_roman should give known result with known input''' 77 | for integer, numeral in self.known_values: 78 | result = roman5.from_roman(numeral) 79 | self.assertEqual(integer, result) 80 | 81 | class ToRomanBadInput(unittest.TestCase): 82 | def test_too_large(self): 83 | '''to_roman should fail with large input''' 84 | self.assertRaises(roman5.OutOfRangeError, roman5.to_roman, 4000) 85 | 86 | def test_zero(self): 87 | '''to_roman should fail with 0 input''' 88 | self.assertRaises(roman5.OutOfRangeError, roman5.to_roman, 0) 89 | 90 | def test_negative(self): 91 | '''to_roman should fail with negative input''' 92 | self.assertRaises(roman5.OutOfRangeError, roman5.to_roman, -1) 93 | 94 | def test_non_integer(self): 95 | '''to_roman should fail with non-integer input''' 96 | self.assertRaises(roman5.NotIntegerError, roman5.to_roman, 0.5) 97 | 98 | class RoundtripCheck(unittest.TestCase): 99 | def test_roundtrip(self): 100 | '''from_roman(to_roman(n))==n for all n''' 101 | for integer in range(1, 4000): 102 | numeral = roman5.to_roman(integer) 103 | result = roman5.from_roman(numeral) 104 | self.assertEqual(integer, result) 105 | 106 | if __name__ == '__main__': 107 | unittest.main() 108 | 109 | # Copyright (c) 2009, Mark Pilgrim, All rights reserved. 110 | # 111 | # Redistribution and use in source and binary forms, with or without modification, 112 | # are permitted provided that the following conditions are met: 113 | # 114 | # * Redistributions of source code must retain the above copyright notice, 115 | # this list of conditions and the following disclaimer. 116 | # * Redistributions in binary form must reproduce the above copyright notice, 117 | # this list of conditions and the following disclaimer in the documentation 118 | # and/or other materials provided with the distribution. 119 | # 120 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' 121 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 122 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 123 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 124 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 125 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 126 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 127 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 128 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 129 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 130 | # POSSIBILITY OF SUCH DAMAGE. 131 | -------------------------------------------------------------------------------- /where-to-go-from-here.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Where to Go From Here - Dive Into Python 3 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 |

  
13 |

You are here: Home Dive Into Python 3 14 | 15 |

Where To Go From Here

16 |
17 |

Go forth on your path, as it exists only through your walking.
— St. Augustine of Hippo (attributed) 18 |

19 |

  20 |

Things to Read

21 |

Unfortunately, I can not write cover every facet of Python 3 in this book. Fortunately, there are many wonderful, freely available tutorials available elsewhere. 22 | 23 |

Decorators: 24 | 25 |

31 | 32 |

Properties: 33 | 34 |

39 | 40 |

Descriptors: 41 | 42 |

48 | 49 |

Threading & multiprocessing:

50 | 51 | 59 | 60 |

Metaclasses: 61 | 62 |

67 | 68 |

In addition, Doug Hellman’s Python Module of the Week is a fantastic guide to many of the modules in the Python standard library. 69 | 70 |

Where To Look For Python 3-Compatible Code

71 | 72 |

As Python 3 is relatively new, there is a dearth of compatible libraries. Here are some of the places to look for code that works with Python 3. 73 | 74 |

82 | 83 |

84 | 85 |

© 2001–11 Mark Pilgrim 86 | 87 | 88 | -------------------------------------------------------------------------------- /examples/romantest6.py: -------------------------------------------------------------------------------- 1 | '''Unit test for roman1.py 2 | 3 | This program is part of 'Dive Into Python 3', a free Python book for 4 | experienced programmers. Visit http://diveintopython3.org/ for the 5 | latest version. 6 | ''' 7 | 8 | import roman6 9 | import unittest 10 | 11 | class KnownValues(unittest.TestCase): 12 | known_values = ( (1, 'I'), 13 | (2, 'II'), 14 | (3, 'III'), 15 | (4, 'IV'), 16 | (5, 'V'), 17 | (6, 'VI'), 18 | (7, 'VII'), 19 | (8, 'VIII'), 20 | (9, 'IX'), 21 | (10, 'X'), 22 | (50, 'L'), 23 | (100, 'C'), 24 | (500, 'D'), 25 | (1000, 'M'), 26 | (31, 'XXXI'), 27 | (148, 'CXLVIII'), 28 | (294, 'CCXCIV'), 29 | (312, 'CCCXII'), 30 | (421, 'CDXXI'), 31 | (528, 'DXXVIII'), 32 | (621, 'DCXXI'), 33 | (782, 'DCCLXXXII'), 34 | (870, 'DCCCLXX'), 35 | (941, 'CMXLI'), 36 | (1043, 'MXLIII'), 37 | (1110, 'MCX'), 38 | (1226, 'MCCXXVI'), 39 | (1301, 'MCCCI'), 40 | (1485, 'MCDLXXXV'), 41 | (1509, 'MDIX'), 42 | (1607, 'MDCVII'), 43 | (1754, 'MDCCLIV'), 44 | (1832, 'MDCCCXXXII'), 45 | (1993, 'MCMXCIII'), 46 | (2074, 'MMLXXIV'), 47 | (2152, 'MMCLII'), 48 | (2212, 'MMCCXII'), 49 | (2343, 'MMCCCXLIII'), 50 | (2499, 'MMCDXCIX'), 51 | (2574, 'MMDLXXIV'), 52 | (2646, 'MMDCXLVI'), 53 | (2723, 'MMDCCXXIII'), 54 | (2892, 'MMDCCCXCII'), 55 | (2975, 'MMCMLXXV'), 56 | (3051, 'MMMLI'), 57 | (3185, 'MMMCLXXXV'), 58 | (3250, 'MMMCCL'), 59 | (3313, 'MMMCCCXIII'), 60 | (3408, 'MMMCDVIII'), 61 | (3501, 'MMMDI'), 62 | (3610, 'MMMDCX'), 63 | (3743, 'MMMDCCXLIII'), 64 | (3844, 'MMMDCCCXLIV'), 65 | (3888, 'MMMDCCCLXXXVIII'), 66 | (3940, 'MMMCMXL'), 67 | (3999, 'MMMCMXCIX')) 68 | 69 | def test_to_roman_known_values(self): 70 | '''to_roman should give known result with known input''' 71 | for integer, numeral in self.known_values: 72 | result = roman6.to_roman(integer) 73 | self.assertEqual(numeral, result) 74 | 75 | def test_from_roman_known_values(self): 76 | '''from_roman should give known result with known input''' 77 | for integer, numeral in self.known_values: 78 | result = roman6.from_roman(numeral) 79 | self.assertEqual(integer, result) 80 | 81 | class ToRomanBadInput(unittest.TestCase): 82 | def test_too_large(self): 83 | '''to_roman should fail with large input''' 84 | self.assertRaises(roman6.OutOfRangeError, roman6.to_roman, 4000) 85 | 86 | def test_zero(self): 87 | '''to_roman should fail with 0 input''' 88 | self.assertRaises(roman6.OutOfRangeError, roman6.to_roman, 0) 89 | 90 | def test_negative(self): 91 | '''to_roman should fail with negative input''' 92 | self.assertRaises(roman6.OutOfRangeError, roman6.to_roman, -1) 93 | 94 | def test_non_integer(self): 95 | '''to_roman should fail with non-integer input''' 96 | self.assertRaises(roman6.NotIntegerError, roman6.to_roman, 0.5) 97 | 98 | class FromRomanBadInput(unittest.TestCase): 99 | def test_too_many_repeated_numerals(self): 100 | '''from_roman should fail with too many repeated numerals''' 101 | for s in ('MMMM', 'DD', 'CCCC', 'LL', 'XXXX', 'VV', 'IIII'): 102 | self.assertRaises(roman6.InvalidRomanNumeralError, roman6.from_roman, s) 103 | 104 | def test_repeated_pairs(self): 105 | '''from_roman should fail with repeated pairs of numerals''' 106 | for s in ('CMCM', 'CDCD', 'XCXC', 'XLXL', 'IXIX', 'IVIV'): 107 | self.assertRaises(roman6.InvalidRomanNumeralError, roman6.from_roman, s) 108 | 109 | def test_malformed_antecedents(self): 110 | '''from_roman should fail with malformed antecedents''' 111 | for s in ('IIMXCC', 'VX', 'DCM', 'CMM', 'IXIV', 112 | 'MCMC', 'XCX', 'IVI', 'LM', 'LD', 'LC'): 113 | self.assertRaises(roman6.InvalidRomanNumeralError, roman6.from_roman, s) 114 | 115 | class RoundtripCheck(unittest.TestCase): 116 | def test_roundtrip(self): 117 | '''from_roman(to_roman(n))==n for all n''' 118 | for integer in range(1, 4000): 119 | numeral = roman6.to_roman(integer) 120 | result = roman6.from_roman(numeral) 121 | self.assertEqual(integer, result) 122 | 123 | if __name__ == '__main__': 124 | unittest.main() 125 | 126 | # Copyright (c) 2009, Mark Pilgrim, All rights reserved. 127 | # 128 | # Redistribution and use in source and binary forms, with or without modification, 129 | # are permitted provided that the following conditions are met: 130 | # 131 | # * Redistributions of source code must retain the above copyright notice, 132 | # this list of conditions and the following disclaimer. 133 | # * Redistributions in binary form must reproduce the above copyright notice, 134 | # this list of conditions and the following disclaimer in the documentation 135 | # and/or other materials provided with the distribution. 136 | # 137 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' 138 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 139 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 140 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 141 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 142 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 143 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 144 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 145 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 146 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 147 | # POSSIBILITY OF SUCH DAMAGE. 148 | -------------------------------------------------------------------------------- /examples/pluraltest6.py: -------------------------------------------------------------------------------- 1 | '''Unit test for plural6.py''' 2 | 3 | import plural6 4 | import unittest 5 | 6 | class KnownValues(unittest.TestCase): 7 | def test_sxz(self): 8 | 'words ending in S, X, and Z' 9 | nouns = { 10 | 'bass': 'basses', 11 | 'bus': 'buses', 12 | 'walrus': 'walruses', 13 | 'box': 'boxes', 14 | 'fax': 'faxes', 15 | 'suffix': 'suffixes', 16 | 'mailbox': 'mailboxes', 17 | 'buzz': 'buzzes', 18 | 'waltz': 'waltzes' 19 | } 20 | for singular, plural in nouns.items(): 21 | self.assertEqual(plural6.plural(singular), plural) 22 | 23 | def test_h(self): 24 | 'words ending in H' 25 | nouns = { 26 | 'coach': 'coaches', 27 | 'glitch': 'glitches', 28 | 'rash': 'rashes', 29 | 'watch': 'watches', 30 | 'cheetah': 'cheetahs', 31 | 'cough': 'coughs' 32 | } 33 | for singular, plural in nouns.items(): 34 | self.assertEqual(plural6.plural(singular), plural) 35 | 36 | def test_y(self): 37 | 'words ending in Y' 38 | nouns = { 39 | 'utility': 'utilities', 40 | 'vacancy': 'vacancies', 41 | 'boy': 'boys', 42 | 'day': 'days' 43 | } 44 | for singular, plural in nouns.items(): 45 | self.assertEqual(plural6.plural(singular), plural) 46 | 47 | def test_ouce(self): 48 | 'words ending in OUSE' 49 | nouns = { 50 | 'mouse': 'mice', 51 | 'louse': 'lice' 52 | } 53 | for singular, plural in nouns.items(): 54 | self.assertEqual(plural6.plural(singular), plural) 55 | 56 | def test_child(self): 57 | 'special case: child' 58 | nouns = { 59 | 'child': 'children' 60 | } 61 | for singular, plural in nouns.items(): 62 | self.assertEqual(plural6.plural(singular), plural) 63 | 64 | def test_oot(self): 65 | 'special case: foot' 66 | nouns = { 67 | 'foot': 'feet' 68 | } 69 | for singular, plural in nouns.items(): 70 | self.assertEqual(plural6.plural(singular), plural) 71 | 72 | def test_ooth(self): 73 | 'words ending in OOTH' 74 | nouns = { 75 | 'booth': 'booths', 76 | 'tooth': 'teeth' 77 | } 78 | for singular, plural in nouns.items(): 79 | self.assertEqual(plural6.plural(singular), plural) 80 | 81 | def test_f_ves(self): 82 | 'words ending in F that become VES' 83 | nouns = { 84 | 'leaf': 'leaves', 85 | 'loaf': 'loaves' 86 | } 87 | for singular, plural in nouns.items(): 88 | self.assertEqual(plural6.plural(singular), plural) 89 | 90 | def test_sis(self): 91 | 'words ending in SIS' 92 | nouns = { 93 | 'thesis': 'theses' 94 | } 95 | for singular, plural in nouns.items(): 96 | self.assertEqual(plural6.plural(singular), plural) 97 | 98 | def test_man(self): 99 | 'words ending in MAN' 100 | nouns = { 101 | 'man': 'men', 102 | 'mailman': 'mailmen', 103 | 'human': 'humans', 104 | 'roman': 'romans' 105 | } 106 | for singular, plural in nouns.items(): 107 | self.assertEqual(plural6.plural(singular), plural) 108 | 109 | def test_ife(self): 110 | 'words ending in IFE' 111 | nouns = { 112 | 'knife': 'knives', 113 | 'wife': 'wives', 114 | 'lowlife': 'lowlifes' 115 | } 116 | for singular, plural in nouns.items(): 117 | self.assertEqual(plural6.plural(singular), plural) 118 | 119 | def test_eau(self): 120 | 'words ending in EAU' 121 | nouns = { 122 | 'tableau': 'tableaux' 123 | } 124 | for singular, plural in nouns.items(): 125 | self.assertEqual(plural6.plural(singular), plural) 126 | 127 | def test_elf(self): 128 | 'words ending in ELF' 129 | nouns = { 130 | 'elf': 'elves', 131 | 'shelf': 'shelves', 132 | 'delf': 'delfs', 133 | 'pelf': 'pelfs' 134 | } 135 | for singular, plural in nouns.items(): 136 | self.assertEqual(plural6.plural(singular), plural) 137 | 138 | def test_same(self): 139 | 'words that are their own plural' 140 | nouns = { 141 | 'sheep': 'sheep', 142 | 'deer': 'deer', 143 | 'fish': 'fish', 144 | 'moose': 'moose', 145 | 'aircraft': 'aircraft', 146 | 'series': 'series', 147 | 'haiku': 'haiku' 148 | } 149 | for singular, plural in nouns.items(): 150 | self.assertEqual(plural6.plural(singular), plural) 151 | 152 | def test_default(self): 153 | 'unexceptional words' 154 | nouns = { 155 | 'papaya': 'papayas', 156 | 'whip': 'whips', 157 | 'palimpsest': 'palimpsests' 158 | } 159 | for singular, plural in nouns.items(): 160 | self.assertEqual(plural6.plural(singular), plural) 161 | 162 | if __name__ == '__main__': 163 | unittest.main() 164 | 165 | # Copyright (c) 2009, Mark Pilgrim, All rights reserved. 166 | # 167 | # Redistribution and use in source and binary forms, with or without modification, 168 | # are permitted provided that the following conditions are met: 169 | # 170 | # * Redistributions of source code must retain the above copyright notice, 171 | # this list of conditions and the following disclaimer. 172 | # * Redistributions in binary form must reproduce the above copyright notice, 173 | # this list of conditions and the following disclaimer in the documentation 174 | # and/or other materials provided with the distribution. 175 | # 176 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' 177 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 178 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 179 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 180 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 181 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 182 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 183 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 184 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 185 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 186 | # POSSIBILITY OF SUCH DAMAGE. 187 | --------------------------------------------------------------------------------