├── LICENSE └── README.rst /LICENSE: -------------------------------------------------------------------------------- 1 | CC0 1.0 Universal 2 | 3 | Statement of Purpose 4 | 5 | The laws of most jurisdictions throughout the world automatically confer 6 | exclusive Copyright and Related Rights (defined below) upon the creator and 7 | subsequent owner(s) (each and all, an "owner") of an original work of 8 | authorship and/or a database (each, a "Work"). 9 | 10 | Certain owners wish to permanently relinquish those rights to a Work for the 11 | purpose of contributing to a commons of creative, cultural and scientific 12 | works ("Commons") that the public can reliably and without fear of later 13 | claims of infringement build upon, modify, incorporate in other works, reuse 14 | and redistribute as freely as possible in any form whatsoever and for any 15 | purposes, including without limitation commercial purposes. These owners may 16 | contribute to the Commons to promote the ideal of a free culture and the 17 | further production of creative, cultural and scientific works, or to gain 18 | reputation or greater distribution for their Work in part through the use and 19 | efforts of others. 20 | 21 | For these and/or other purposes and motivations, and without any expectation 22 | of additional consideration or compensation, the person associating CC0 with a 23 | Work (the "Affirmer"), to the extent that he or she is an owner of Copyright 24 | and Related Rights in the Work, voluntarily elects to apply CC0 to the Work 25 | and publicly distribute the Work under its terms, with knowledge of his or her 26 | Copyright and Related Rights in the Work and the meaning and intended legal 27 | effect of CC0 on those rights. 28 | 29 | 1. Copyright and Related Rights. A Work made available under CC0 may be 30 | protected by copyright and related or neighboring rights ("Copyright and 31 | Related Rights"). Copyright and Related Rights include, but are not limited 32 | to, the following: 33 | 34 | i. the right to reproduce, adapt, distribute, perform, display, communicate, 35 | and translate a Work; 36 | 37 | ii. moral rights retained by the original author(s) and/or performer(s); 38 | 39 | iii. publicity and privacy rights pertaining to a person's image or likeness 40 | depicted in a Work; 41 | 42 | iv. rights protecting against unfair competition in regards to a Work, 43 | subject to the limitations in paragraph 4(a), below; 44 | 45 | v. rights protecting the extraction, dissemination, use and reuse of data in 46 | a Work; 47 | 48 | vi. database rights (such as those arising under Directive 96/9/EC of the 49 | European Parliament and of the Council of 11 March 1996 on the legal 50 | protection of databases, and under any national implementation thereof, 51 | including any amended or successor version of such directive); and 52 | 53 | vii. other similar, equivalent or corresponding rights throughout the world 54 | based on applicable law or treaty, and any national implementations thereof. 55 | 56 | 2. Waiver. To the greatest extent permitted by, but not in contravention of, 57 | applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and 58 | unconditionally waives, abandons, and surrenders all of Affirmer's Copyright 59 | and Related Rights and associated claims and causes of action, whether now 60 | known or unknown (including existing as well as future claims and causes of 61 | action), in the Work (i) in all territories worldwide, (ii) for the maximum 62 | duration provided by applicable law or treaty (including future time 63 | extensions), (iii) in any current or future medium and for any number of 64 | copies, and (iv) for any purpose whatsoever, including without limitation 65 | commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes 66 | the Waiver for the benefit of each member of the public at large and to the 67 | detriment of Affirmer's heirs and successors, fully intending that such Waiver 68 | shall not be subject to revocation, rescission, cancellation, termination, or 69 | any other legal or equitable action to disrupt the quiet enjoyment of the Work 70 | by the public as contemplated by Affirmer's express Statement of Purpose. 71 | 72 | 3. Public License Fallback. Should any part of the Waiver for any reason be 73 | judged legally invalid or ineffective under applicable law, then the Waiver 74 | shall be preserved to the maximum extent permitted taking into account 75 | Affirmer's express Statement of Purpose. In addition, to the extent the Waiver 76 | is so judged Affirmer hereby grants to each affected person a royalty-free, 77 | non transferable, non sublicensable, non exclusive, irrevocable and 78 | unconditional license to exercise Affirmer's Copyright and Related Rights in 79 | the Work (i) in all territories worldwide, (ii) for the maximum duration 80 | provided by applicable law or treaty (including future time extensions), (iii) 81 | in any current or future medium and for any number of copies, and (iv) for any 82 | purpose whatsoever, including without limitation commercial, advertising or 83 | promotional purposes (the "License"). The License shall be deemed effective as 84 | of the date CC0 was applied by Affirmer to the Work. Should any part of the 85 | License for any reason be judged legally invalid or ineffective under 86 | applicable law, such partial invalidity or ineffectiveness shall not 87 | invalidate the remainder of the License, and in such case Affirmer hereby 88 | affirms that he or she will not (i) exercise any of his or her remaining 89 | Copyright and Related Rights in the Work or (ii) assert any associated claims 90 | and causes of action with respect to the Work, in either case contrary to 91 | Affirmer's express Statement of Purpose. 92 | 93 | 4. Limitations and Disclaimers. 94 | 95 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 96 | surrendered, licensed or otherwise affected by this document. 97 | 98 | b. Affirmer offers the Work as-is and makes no representations or warranties 99 | of any kind concerning the Work, express, implied, statutory or otherwise, 100 | including without limitation warranties of title, merchantability, fitness 101 | for a particular purpose, non infringement, or the absence of latent or 102 | other defects, accuracy, or the present or absence of errors, whether or not 103 | discoverable, all to the greatest extent permissible under applicable law. 104 | 105 | c. Affirmer disclaims responsibility for clearing rights of other persons 106 | that may apply to the Work or any use thereof, including without limitation 107 | any person's Copyright and Related Rights in the Work. Further, Affirmer 108 | disclaims responsibility for obtaining any necessary consents, permissions 109 | or other rights required for any use of the Work. 110 | 111 | d. Affirmer understands and acknowledges that Creative Commons is not a 112 | party to this document and has no duty or obligation with respect to this 113 | CC0 or use of the Work. 114 | 115 | For more information, please see 116 | 117 | 118 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | python_learners_glossary 2 | ======================== 3 | 4 | Definitions of Python jargon to help Python beginners 5 | understand Pythonista gobbletigook. The idea is to 6 | help a Python beginner's understanding even before 7 | they've learned to write the code. 8 | 9 | CONTRIBUTING 10 | ============ 11 | 12 | Please submit issues_ and `pull requests`_! 13 | 14 | 1. Clarity 15 | 2. Conciseness 16 | 3. Accuracy 17 | 18 | ... are all desirable - *in that order*. 19 | Don't get pedantic or hung up on `corner cases`_. 20 | 21 | Terms to define are not strictly Python terms, 22 | but any terms likely to be frequently heard at 23 | a Python conference. 24 | 25 | To reduce cognitive load, let's use examples around 26 | a consistent, familiar theme: cats. 27 | 28 | Glossary 29 | ======== 30 | 31 | Basic 32 | ----- 33 | 34 | .. _execute: 35 | 36 | Execute 37 | Go. Run. Do that thing you do. Nothing to do 38 | with beheading anybody. 39 | 40 | Data 41 | ---- 42 | 43 | .. _value: 44 | 45 | Value 46 | A single piece of data, like ``3`` or ``'Fluffy'`` 47 | 48 | String 49 | A piece of text data, like ``'hello'``. Enclosing it 50 | in quotation marks 51 | tells Python that it's a string and not something like 52 | a variable_ name. 53 | 54 | Float 55 | Short for *floating-point number*, a number with a 56 | decimal point. 57 | 58 | .. _variable: 59 | 60 | Variable 61 | A piece of data that has a name. 62 | 63 | :: 64 | 65 | cat_name = 'Fluffy' 66 | 67 | Now ``cat_name`` is a *variable* with the value_ 'Fluffy'. 68 | 69 | Assign 70 | Give a name to a value_, making a variable_. 71 | 72 | Expression 73 | A description of a value that contains 74 | calculations and/or 75 | other executable code; the code must be 76 | executed to determine the expression's 77 | actual value. Typically, 78 | these fit on one line, but not necessarily. 79 | 80 | Examples:: 81 | 82 | 'lazy ' + 'cat' # Evaluates to 'lazy cat' 83 | 2 * 2 > 100 # Evaluates to ``False`` 84 | 85 | Boolean 86 | ``True`` or ``False``. 87 | 88 | .. _list: 89 | 90 | List 91 | A series of values. Python will remember what order they 92 | come in. 93 | 94 | :: 95 | 96 | ['Mouser', 17, 'Whiskers'] 97 | 98 | Tuple 99 | A series of values. Python will remember what order they 100 | come in. 101 | 102 | Hey, is that the same as a list_? It's very similar, but 103 | after a tuple is set up, you're not allowed to change 104 | it. 105 | 106 | :: 107 | 108 | ('Mouser', 17, 'Whiskers') 109 | 110 | Set 111 | Just like in mathematics - a group of values. Python 112 | will *not* necessarily remember what order they came 113 | in, and each value_ can only appear in the set once. 114 | 115 | Functions 116 | --------- 117 | 118 | .. _function: 119 | 120 | Function 121 | A named series of instructions. Its definition 122 | begins with the `def` keyword. 123 | 124 | :: 125 | 126 | def feed_cat(kg_of_food, kg_of_cat): 127 | kg_of_food = kg_of_food - 0.1 128 | kg_of_cat = kg_of_cat + 0.1 129 | 130 | .. _call: 131 | .. _called: 132 | 133 | Call 134 | Tell a function_ to execute_. To call a 135 | function, give its name followed by 136 | parenthesis containing its arguments_ (if 137 | any). 138 | 139 | :: 140 | 141 | feed_cat(8.0, 3.0) 142 | 143 | .. _argument: 144 | .. _arguments: 145 | 146 | Argument 147 | A piece of data that you "pass" (give) to a 148 | function_ as you call_ it. In our ``feed_cat`` 149 | function_, ``kg_of_food`` and ``kg_of_cat`` are 150 | the function's arguments. 151 | 152 | Parameter 153 | Synonym for argument_. 154 | 155 | Return 156 | Stop running a function_ and return to the place 157 | where the function was called_ from. Send a 158 | value_ back - the "return value". 159 | 160 | Object-oriented 161 | --------------- 162 | 163 | .. _object: 164 | .. _objects: 165 | 166 | Object 167 | A logical grouping of functions (called "methods_" 168 | in this context) and variables 169 | (called "attributes_" in this context). 170 | 171 | .. _method: 172 | .. _methods: 173 | 174 | Method 175 | A function that *belongs to* an object and 176 | "knows" about the object it belongs to. 177 | For instance, if `my_cat` is an object 178 | that has a `speak` method, then we can 179 | call_ it:: 180 | 181 | my_cat.speak() 182 | 'meow' 183 | 184 | ... and `my_cat.speak` doesn't need to be told what 185 | kind of animal should speak, because it already 186 | knows that it belongs to `my_cat`. 187 | 188 | .. attribute_: 189 | .. attributes_: 190 | 191 | Attribute 192 | A piece of data that belongs to an object. 193 | This object, ``my_cat``, has a ``name`` attribute 194 | with the value ``'Agamemnon'``.`` 195 | 196 | :: 197 | 198 | my_cat.name 199 | 'Agamemnon' 200 | 201 | .. _class: 202 | .. _classes: 203 | 204 | Class 205 | TODO 206 | 207 | Instance 208 | An object_ of a given class_. `my_cat` is an 209 | *instance* of the class `Cat`. 210 | 211 | Instantiate 212 | Create a new `instance` of a given class. 213 | When `my_cat` has kittens, she is instantiating 214 | several new instances of the class `Cat`. 215 | (Please spay our neuter your pets!) 216 | 217 | Object-oriented programming 218 | Programming that makes use of classes_ and objects_. 219 | 220 | Dunder 221 | The two underscores before and after a method name to 222 | indicate that it is "magic", i.e. __init__, __new__, etc. 223 | (Short for "Double-underscore") 224 | 225 | Magic Method 226 | Methods that can be used to change the normal 227 | behavior of an object. HINT : in Python, everything is an object. 228 | 229 | Program Structure 230 | ----------------- 231 | 232 | .. _module: 233 | 234 | Module 235 | A single file of Python commands. Calling it a 236 | module implies we plan to "import" it, not just 237 | call it on its own. 238 | 239 | .. _package: 240 | 241 | Package 242 | A directory full of modules that can all together 243 | be referred to by the package's name. 244 | 245 | Import 246 | Make the contents of a module_ or package_ available 247 | in your current program, even though it comes outside 248 | your current program's file. 249 | 250 | Tools 251 | ----- 252 | 253 | .. _editor: 254 | 255 | Editor 256 | A program to create or change files. We usually mean 257 | *text editor*, since a Python program is a kind of 258 | text file. Notepad is an example of an editor 259 | (but don't use Notepad to edit Python, it can 260 | introduce mistakes into your Python programs; 261 | `Notepad++`_ is a good alternative). 262 | 263 | .. _`Notepad++`: https://notepad-plus-plus.org/ 264 | 265 | IDE 266 | Abbreviation for Integrated Development Environment. 267 | A kind of text editor_ with programming-related 268 | superpowers; a program that lets you build more programs. 269 | Examples include Eclipse, Sublime, Wingware, and IDLE 270 | 271 | Database 272 | A place to store data outside the program, 273 | possibly in memory ("in-memory databases") 274 | but generally on disk. A file on disk could 275 | be considered a *very simple* database, but 276 | we usually mean much more advanced programs. 277 | 278 | .. _`relational database`: 279 | 280 | Relational database 281 | A very common kind of database that's good 282 | at retrieving data that have relationships 283 | to one another. For instance, a question like 284 | "How expensive is the cat food brand that most 285 | of my cats prefer?" is usually easier to answer 286 | in a relational database than in other types 287 | of database. 288 | 289 | RDBMS 290 | Relational database management system - basically 291 | a synonym for `relational database`. 292 | 293 | SQL 294 | The specialized language usually used to get 295 | and manipulate data in a `relational database`_. 296 | 297 | SQL database 298 | More or less a synonym for `relational database`_. 299 | 300 | .. _`non-relational database`: 301 | An alternative to a `relational database`. It's 302 | generally easier to use and often faster to run, 303 | but has its own disadvantages for complex kinds 304 | of data access. 305 | 306 | .. `NoSQL database`: 307 | More or less a synonym for `non_relational database`_. 308 | 309 | Techniques 310 | ---------- 311 | 312 | .. _bug: 313 | .. _bugs: 314 | 315 | Bug 316 | A mistake in software that makes it crash or 317 | behave badly. 318 | 319 | Debug 320 | Fix bugs_ 321 | 322 | Refactor 323 | Change a program so that the functionality seems 324 | the same from the user's point of view, but the 325 | code itself is better - easier to read, understand, 326 | maintain, etc. 327 | 328 | Agile Development 329 | TODO 330 | 331 | Version Control 332 | --------------- 333 | 334 | Version Control 335 | Tools and techniques for keeping track of the 336 | changes in files in a reversible way. More 337 | importantly, it helps people cooperate on 338 | changes to a file without ruining each others' 339 | work. 340 | 341 | .. _issue: 342 | .. _issues: 343 | 344 | Issue 345 | Request for a specific change to software, 346 | either to fix a bug_ or provide new features 347 | ("enhancement"). Issues are usually filed 348 | in a project's `bug tracker`_. 349 | 350 | Bug report 351 | A category of issue_ for notifying the programmers 352 | of a bug_ 353 | 354 | .. _repository: 355 | .. _repositories: 356 | 357 | Repository 358 | A record on disk of the `version control`_ history 359 | for a directory (and its subdirectories). Usually 360 | we mean someplace on line, usually at a service like 361 | github_. 362 | 363 | Repo 364 | Abbreviation for repository_. 365 | 366 | Branch 367 | TODO 368 | 369 | .. _fork: 370 | 371 | Fork 372 | TODO 373 | 374 | .. _pull request: 375 | .. _pull requests: 376 | 377 | Pull Request 378 | After you have fork_ed a repository_ and made 379 | changes, you may ask the original repository 380 | owner to incorporate ("pull") your changes into the 381 | original repository. 382 | 383 | Git 384 | The most popular program for version control. 385 | 386 | Mercurial 387 | Another version control program 388 | 389 | Github 390 | The most popular commercial service that 391 | hosts version control 392 | repositories_ online. 393 | 394 | Bitbucket 395 | Another commercial service for hosting version 396 | control repositories_. 397 | 398 | Testing 399 | ------- 400 | 401 | Testing 402 | To programmers, them means scripts that verify 403 | that a program works as desired automatically. 404 | We rarely talk about non-automated, direct human 405 | testing, because it's soul-sucking and can't keep 406 | up with our speed of generating bugs_. 407 | 408 | Regression test 409 | Tests to make sure that one part of a program 410 | doesn't get worse - *regress* - as improvements 411 | aren't made to a different part. All of our 412 | tests could generally be considered regression 413 | tests. 414 | 415 | .. _`unit test`: 416 | 417 | Unit Test 418 | A fine-scale test that works directly on one small 419 | piece 420 | of a program, at a scale finer than the end-user 421 | will directly see. Contrast `functional test`_. 422 | 423 | .. _`functional test`: 424 | 425 | Functional test 426 | A test that makes sure a program is working from 427 | the user's point of view. Contrast `unit test`_. 428 | 429 | Test-Driven Development 430 | A style of development where you first write the 431 | tests saying what you want the program to do - 432 | even before the program exists. Then you write 433 | the code until the tests no longer fail. 434 | 435 | Corner Case 436 | A situation that's likely to show bugs_ in code 437 | because it's so unusual that the developers were 438 | unlikely to account for it. For instance, if you 439 | are classifying cats by their eye color, a cat with 440 | two different-color eyes may be a corner case that 441 | disrupts your classification scheme. 442 | 443 | Packaging 444 | --------- 445 | 446 | PyPI 447 | `PyPI `_, pronounced "Pie-Pee-Eye" and also 448 | known as *The Cheeseshop*, is the "Python Packaging Index". 449 | It is where you can publish and download open source Python packages. 450 | 451 | pip 452 | `pip `_ is the recommended tool 453 | for installing Python packages and is preferred over 454 | `easy_install `_. 455 | 456 | Architecture 457 | ------------ 458 | 459 | API 460 | Shorthand for "application programmer interface". 461 | This is the way that other programs can make use 462 | of this program. Web services can have APIs that 463 | let them accept messages from other programs and send 464 | messages back in response. 465 | 466 | Examples include POSIX (the unix/Linux API), Win32, 467 | Cocoa, Amazon AWS, and Android. However, many other 468 | services have APIs to add things like (for instance) 469 | Dropbox and Facebook to your app. 470 | 471 | TODO: generalize this more 472 | 473 | Operations 474 | ---------- 475 | 476 | Operations 477 | Activities related to deploy_ing software and 478 | keeping it running on its destination servers. 479 | 480 | DevOps 481 | Philosophy and tools for operations_ that try to 482 | make the process as automatic and failsafe as 483 | possible by imitating software developers' tools 484 | and techniqes. 485 | 486 | .. _deploy: 487 | 488 | Deploy 489 | To deliver a completed program so that other 490 | people can use it. Ususually different than 491 | just programming it so that it works. Sometimes, 492 | a program needs to be installed in a package, 493 | or through an App Store, or maybe it just needs to 494 | be on the web. That last step to make it so that 495 | other people can reach it is called "deployment" 496 | 497 | Build 498 | TODO 499 | 500 | Build Server 501 | TODO 502 | 503 | Continuous Integration 504 | TODO 505 | --------------------------------------------------------------------------------