workspace stringclasses 1
value | channel stringclasses 1
value | sentences stringlengths 1 3.93k | ts stringlengths 26 26 | user stringlengths 2 11 | sentence_id stringlengths 44 53 | timestamp float64 1.5B 1.56B | __index_level_0__ int64 0 106k |
|---|---|---|---|---|---|---|---|
pythondev | help | "A finally clause is always executed before leaving the try statement, whether an exception has occurred or not. When an exception has occurred in the try clause and has not been handled by an except clause (or it has occurred in an except or else clause), it is re-raised after the finally clause has been executed. The finally clause is also executed “on the way out” when any other clause of the try statement is left via a break, continue or return statement. A more complicated example:" | 2017-10-05T12:32:40.000168 | Kym | pythondev_help_Kym_2017-10-05T12:32:40.000168 | 1,507,206,760.000168 | 96,003 |
pythondev | help | I linked to the reference docs, that's where the quote comes from | 2017-10-05T12:33:48.000377 | Mallie | pythondev_help_Mallie_2017-10-05T12:33:48.000377 | 1,507,206,828.000377 | 96,004 |
pythondev | help | For python2 | 2017-10-05T12:33:55.000447 | Kym | pythondev_help_Kym_2017-10-05T12:33:55.000447 | 1,507,206,835.000447 | 96,005 |
pythondev | help | But I'm using python 3 | 2017-10-05T12:34:01.000491 | Kym | pythondev_help_Kym_2017-10-05T12:34:01.000491 | 1,507,206,841.000491 | 96,006 |
pythondev | help | IN the 3docs it says nothing about discarding exceptions | 2017-10-05T12:34:12.000429 | Kym | pythondev_help_Kym_2017-10-05T12:34:12.000429 | 1,507,206,852.000429 | 96,007 |
pythondev | help | :open_mouth: | 2017-10-05T12:34:15.000750 | Kym | pythondev_help_Kym_2017-10-05T12:34:15.000750 | 1,507,206,855.00075 | 96,008 |
pythondev | help | Oh, you said
> I'm using python2 | 2017-10-05T12:34:22.000075 | Mallie | pythondev_help_Mallie_2017-10-05T12:34:22.000075 | 1,507,206,862.000075 | 96,009 |
pythondev | help | Yeah not sure, can't check atm | 2017-10-05T12:34:27.000057 | Mallie | pythondev_help_Mallie_2017-10-05T12:34:27.000057 | 1,507,206,867.000057 | 96,010 |
pythondev | help | Oh, I did. My bad. | 2017-10-05T12:34:31.000664 | Kym | pythondev_help_Kym_2017-10-05T12:34:31.000664 | 1,507,206,871.000664 | 96,011 |
pythondev | help | But maybe it's not as clear lol | 2017-10-05T12:34:33.000692 | Mallie | pythondev_help_Mallie_2017-10-05T12:34:33.000692 | 1,507,206,873.000692 | 96,012 |
pythondev | help | I mean it's pretty logical it's going to discard one if a second exception is raised in the finally | 2017-10-05T12:35:34.000077 | Ciera | pythondev_help_Ciera_2017-10-05T12:35:34.000077 | 1,507,206,934.000077 | 96,013 |
pythondev | help | I don't really see how they could have done different | 2017-10-05T12:35:42.000299 | Ciera | pythondev_help_Ciera_2017-10-05T12:35:42.000299 | 1,507,206,942.000299 | 96,014 |
pythondev | help | the 3 docs have it in there also | 2017-10-05T12:38:05.000764 | Sirena | pythondev_help_Sirena_2017-10-05T12:38:05.000764 | 1,507,207,085.000764 | 96,015 |
pythondev | help | about a page down
<https://docs.python.org/3/reference/compound_stmts.html#finally> | 2017-10-05T12:38:19.000478 | Sirena | pythondev_help_Sirena_2017-10-05T12:38:19.000478 | 1,507,207,099.000478 | 96,016 |
pythondev | help | ```If finally is present, it specifies a ‘cleanup’ handler. The try clause is executed, including any except and else clauses. If an exception occurs in any of the clauses and is not handled, the exception is temporarily saved. The finally clause is executed. If there is a saved exception it is re-raised at the end of the finally clause. If the finally clause raises another exception, the saved exception is set as the context of the new exception. If the finally clause executes a return or break statement, the saved exception is discarded:``` | 2017-10-05T12:38:48.000154 | Sirena | pythondev_help_Sirena_2017-10-05T12:38:48.000154 | 1,507,207,128.000154 | 96,017 |
pythondev | help | Good find <@Shavonda> | 2017-10-05T12:40:25.000568 | Kym | pythondev_help_Kym_2017-10-05T12:40:25.000568 | 1,507,207,225.000568 | 96,018 |
pythondev | help | Bu | 2017-10-05T12:40:27.000668 | Kym | pythondev_help_Kym_2017-10-05T12:40:27.000668 | 1,507,207,227.000668 | 96,019 |
pythondev | help | But I still believe it should be mentioned in /tutorial/errors | 2017-10-05T12:40:47.000355 | Kym | pythondev_help_Kym_2017-10-05T12:40:47.000355 | 1,507,207,247.000355 | 96,020 |
pythondev | help | I agree with you | 2017-10-05T12:40:57.000344 | Sirena | pythondev_help_Sirena_2017-10-05T12:40:57.000344 | 1,507,207,257.000344 | 96,021 |
pythondev | help | So, the novel has concluded :3
try:
...
except Exception as e:
raise(e)
finally:
curs.connection.commit()
curs.connection.close()
return len(root.getchildren())
So:
1. A finally clause is always executed **before** leaving the try statement,
- so execution looks like so: try>finally>except
2. whether an exception has occurred or not
- in this case an exception occurred in the try block
3. When an exception has occurred in the try clause and has not been handled by an except clause
- in this case the exception wasn't handled by the except clause because there was a finally
4. it is re-raised after the finally clause has been executed
- but the finally clause returns, so we leave context and never come back to execute the except block | 2017-10-05T12:41:25.000115 | Kym | pythondev_help_Kym_2017-10-05T12:41:25.000115 | 1,507,207,285.000115 | 96,022 |
pythondev | help | Jum ... what's the preferred way to suggest changes to the docu? | 2017-10-05T12:41:47.000702 | Kym | pythondev_help_Kym_2017-10-05T12:41:47.000702 | 1,507,207,307.000702 | 96,023 |
pythondev | help | Pull request? | 2017-10-05T12:41:55.000248 | Kym | pythondev_help_Kym_2017-10-05T12:41:55.000248 | 1,507,207,315.000248 | 96,024 |
pythondev | help | Well tutorial is kinda more "things you should do or most people do do", the reference should be complete | 2017-10-05T12:42:19.000198 | Mallie | pythondev_help_Mallie_2017-10-05T12:42:19.000198 | 1,507,207,339.000198 | 96,025 |
pythondev | help | But, a fun gotcha I'll give you that | 2017-10-05T12:42:26.000296 | Mallie | pythondev_help_Mallie_2017-10-05T12:42:26.000296 | 1,507,207,346.000296 | 96,026 |
pythondev | help | "fun" ... speak for yourself :stuck_out_tongue: | 2017-10-05T12:42:41.000279 | Kym | pythondev_help_Kym_2017-10-05T12:42:41.000279 | 1,507,207,361.000279 | 96,027 |
pythondev | help | Stumpers are the best errors! | 2017-10-05T12:42:51.000599 | Mallie | pythondev_help_Mallie_2017-10-05T12:42:51.000599 | 1,507,207,371.000599 | 96,028 |
pythondev | help | You grew, even if you don't know it yet :evergreen_tree: | 2017-10-05T12:43:01.000566 | Mallie | pythondev_help_Mallie_2017-10-05T12:43:01.000566 | 1,507,207,381.000566 | 96,029 |
pythondev | help | That's true | 2017-10-05T12:43:35.000189 | Kym | pythondev_help_Kym_2017-10-05T12:43:35.000189 | 1,507,207,415.000189 | 96,030 |
pythondev | help | Thanks for helping everyone, I wasn't expecting this bug to be so ... "insightful?" :slightly_smiling_face: | 2017-10-05T12:46:24.000275 | Kym | pythondev_help_Kym_2017-10-05T12:46:24.000275 | 1,507,207,584.000275 | 96,031 |
pythondev | help | it's still try > except > finally | 2017-10-05T12:48:03.000034 | Sirena | pythondev_help_Sirena_2017-10-05T12:48:03.000034 | 1,507,207,683.000034 | 96,032 |
pythondev | help | but if you have
```except Exception as e:
raise (e)
finally:
return 'something'``` | 2017-10-05T12:49:10.000406 | Sirena | pythondev_help_Sirena_2017-10-05T12:49:10.000406 | 1,507,207,750.000406 | 96,033 |
pythondev | help | the `raise (e)` doesn't do anything, because the finally runs after it, discarding the exception | 2017-10-05T12:49:28.000436 | Sirena | pythondev_help_Sirena_2017-10-05T12:49:28.000436 | 1,507,207,768.000436 | 96,034 |
pythondev | help | <@Kym> Yeah, nice interview question! lol | 2017-10-05T12:49:46.000245 | Mallie | pythondev_help_Mallie_2017-10-05T12:49:46.000245 | 1,507,207,786.000245 | 96,035 |
pythondev | help | or at least, that's the way it looks to me | 2017-10-05T12:50:35.000055 | Sirena | pythondev_help_Sirena_2017-10-05T12:50:35.000055 | 1,507,207,835.000055 | 96,036 |
pythondev | help | really the more I think about this, the more I think it should be a warning to put return inside finally, but maybe there's a corner case where it's appropriate | 2017-10-05T12:53:00.000199 | Sirena | pythondev_help_Sirena_2017-10-05T12:53:00.000199 | 1,507,207,980.000199 | 96,037 |
pythondev | help | I agree, <@Sirena> | 2017-10-05T12:54:17.000261 | Kym | pythondev_help_Kym_2017-10-05T12:54:17.000261 | 1,507,208,057.000261 | 96,038 |
pythondev | help | Regarding your second statement | 2017-10-05T12:54:30.000308 | Kym | pythondev_help_Kym_2017-10-05T12:54:30.000308 | 1,507,208,070.000308 | 96,039 |
pythondev | help | Regarding the second one I'd still say it's try>except>finally | 2017-10-05T12:54:48.000569 | Kym | pythondev_help_Kym_2017-10-05T12:54:48.000569 | 1,507,208,088.000569 | 96,040 |
pythondev | help | It says, finally is always executed after try | 2017-10-05T12:55:04.000003 | Kym | pythondev_help_Kym_2017-10-05T12:55:04.000003 | 1,507,208,104.000003 | 96,041 |
pythondev | help | Otherwise it wouldn't work | 2017-10-05T12:55:10.000719 | Kym | pythondev_help_Kym_2017-10-05T12:55:10.000719 | 1,507,208,110.000719 | 96,042 |
pythondev | help | I mean, the purpose of finally is to be executed before execution is terminated | 2017-10-05T12:55:26.000297 | Kym | pythondev_help_Kym_2017-10-05T12:55:26.000297 | 1,507,208,126.000297 | 96,043 |
pythondev | help | and this happens after the raise | 2017-10-05T12:55:34.000593 | Kym | pythondev_help_Kym_2017-10-05T12:55:34.000593 | 1,507,208,134.000593 | 96,044 |
pythondev | help | no? | 2017-10-05T12:55:37.000078 | Kym | pythondev_help_Kym_2017-10-05T12:55:37.000078 | 1,507,208,137.000078 | 96,045 |
pythondev | help | ```
>>> try:
... print('one')
... 1/0
... except:
... print('two')
... else:
... print('...')
... finally:
... print('three')
...
one
two
three
``` | 2017-10-05T12:55:54.000379 | Suellen | pythondev_help_Suellen_2017-10-05T12:55:54.000379 | 1,507,208,154.000379 | 96,046 |
pythondev | help | Hm ... | 2017-10-05T12:56:44.000644 | Kym | pythondev_help_Kym_2017-10-05T12:56:44.000644 | 1,507,208,204.000644 | 96,047 |
pythondev | help | What if we do a raise instead of print('two') | 2017-10-05T12:57:02.000404 | Kym | pythondev_help_Kym_2017-10-05T12:57:02.000404 | 1,507,208,222.000404 | 96,048 |
pythondev | help | ? | 2017-10-05T12:57:04.000018 | Kym | pythondev_help_Kym_2017-10-05T12:57:04.000018 | 1,507,208,224.000018 | 96,049 |
pythondev | help | Does print('three') happen before th | 2017-10-05T12:57:34.000453 | Kym | pythondev_help_Kym_2017-10-05T12:57:34.000453 | 1,507,208,254.000453 | 96,050 |
pythondev | help | the raise or after? I think it makes a difference, let me try. | 2017-10-05T12:57:49.000077 | Kym | pythondev_help_Kym_2017-10-05T12:57:49.000077 | 1,507,208,269.000077 | 96,051 |
pythondev | help | line 7 is never executed | 2017-10-05T13:02:17.000658 | Kym | pythondev_help_Kym_2017-10-05T13:02:17.000658 | 1,507,208,537.000658 | 96,052 |
pythondev | help | even without the return | 2017-10-05T13:02:29.000244 | Kym | pythondev_help_Kym_2017-10-05T13:02:29.000244 | 1,507,208,549.000244 | 96,053 |
pythondev | help | which makes sense ... because that's what raise is for | 2017-10-05T13:03:01.000732 | Kym | pythondev_help_Kym_2017-10-05T13:03:01.000732 | 1,507,208,581.000732 | 96,054 |
pythondev | help | Hm ... the sequence is indeed:
try > except > finally
The only problem was that although raise triggered an exception and the exception was saved, return led to it being discarded. | 2017-10-05T13:05:58.000291 | Kym | pythondev_help_Kym_2017-10-05T13:05:58.000291 | 1,507,208,758.000291 | 96,055 |
pythondev | help | I'm looking to level up. I was debating between [Git, debugging/IDE, concept deep dive in Python like decorators/metaclasses, something else]. I'm out of n00bie and into rookie territory. Any suggestions? | 2017-10-05T14:10:48.000382 | Seema | pythondev_help_Seema_2017-10-05T14:10:48.000382 | 1,507,212,648.000382 | 96,056 |
pythondev | help | When you say git <@Seema> do you mean you don't have experience with version control or you want to dig into git guts? | 2017-10-05T14:12:59.000548 | Mallie | pythondev_help_Mallie_2017-10-05T14:12:59.000548 | 1,507,212,779.000548 | 96,057 |
pythondev | help | inexperienced with version control | 2017-10-05T14:13:36.000119 | Seema | pythondev_help_Seema_2017-10-05T14:13:36.000119 | 1,507,212,816.000119 | 96,058 |
pythondev | help | Do that - pick some sort of task you want to accomplish and use git to do it and track changes, etc. and so on | 2017-10-05T14:14:02.000322 | Mallie | pythondev_help_Mallie_2017-10-05T14:14:02.000322 | 1,507,212,842.000322 | 96,059 |
pythondev | help | In terms of "things" developers do, after you understand basic logic, that is the most necessary and pragmatic thing | 2017-10-05T14:14:25.000307 | Mallie | pythondev_help_Mallie_2017-10-05T14:14:25.000307 | 1,507,212,865.000307 | 96,060 |
pythondev | help | yeah, and it might be a false choice, you'll probably learn a bit of everything as you go along | 2017-10-05T14:14:39.000381 | Sirena | pythondev_help_Sirena_2017-10-05T14:14:39.000381 | 1,507,212,879.000381 | 96,061 |
pythondev | help | In terms of "doing" code, it is absolutely essential to not just having a rat's nest history | 2017-10-05T14:14:42.000304 | Mallie | pythondev_help_Mallie_2017-10-05T14:14:42.000304 | 1,507,212,882.000304 | 96,062 |
pythondev | help | OK, thanks. I've been using PyCharm. Would you suggest using version control through there or go full command line crazy for the learning part? | 2017-10-05T14:15:33.000418 | Seema | pythondev_help_Seema_2017-10-05T14:15:33.000418 | 1,507,212,933.000418 | 96,063 |
pythondev | help | Dunno PyCharm so get another opinion. I do it on the command line personally (and gitlab, github, etc.) | 2017-10-05T14:15:56.000381 | Mallie | pythondev_help_Mallie_2017-10-05T14:15:56.000381 | 1,507,212,956.000381 | 96,064 |
pythondev | help | But I am mostly comfortable on the command line | 2017-10-05T14:16:05.000350 | Mallie | pythondev_help_Mallie_2017-10-05T14:16:05.000350 | 1,507,212,965.00035 | 96,065 |
pythondev | help | try both I would say. command line git isn't what I would call user friendly, but it does give you the most power and flexibility | 2017-10-05T14:16:50.000111 | Sirena | pythondev_help_Sirena_2017-10-05T14:16:50.000111 | 1,507,213,010.000111 | 96,066 |
pythondev | help | What matters is concepts, for the most part, so it depends how/where you want to work IMO | 2017-10-05T14:16:53.000202 | Mallie | pythondev_help_Mallie_2017-10-05T14:16:53.000202 | 1,507,213,013.000202 | 96,067 |
pythondev | help | If PyCharm abstracts a lot of what git works is _meant_ to do, I'd be kinda meh about that... | 2017-10-05T14:17:06.000270 | Mallie | pythondev_help_Mallie_2017-10-05T14:17:06.000270 | 1,507,213,026.00027 | 96,068 |
pythondev | help | But I really doubt that, it's probably just a nice wrapper | 2017-10-05T14:17:17.000075 | Mallie | pythondev_help_Mallie_2017-10-05T14:17:17.000075 | 1,507,213,037.000075 | 96,069 |
pythondev | help | I changed that - I mean to imply _why_ VC and not _how_ VC | 2017-10-05T14:17:53.000328 | Mallie | pythondev_help_Mallie_2017-10-05T14:17:53.000328 | 1,507,213,073.000328 | 96,070 |
pythondev | help | Though the how is cool | 2017-10-05T14:18:04.000654 | Mallie | pythondev_help_Mallie_2017-10-05T14:18:04.000654 | 1,507,213,084.000654 | 96,071 |
pythondev | help | Also if you ever care to contribute to OSS <@Seema> it's obviously essential, plus, as you read diffs and patches and make sense of commits, etc. you'll get better at interpreting/reading code, which is something I know you are working on | 2017-10-05T14:19:11.000417 | Mallie | pythondev_help_Mallie_2017-10-05T14:19:11.000417 | 1,507,213,151.000417 | 96,072 |
pythondev | help | I use PyCharm, but for a variety of team-related reasons I use the command line for git interactions | 2017-10-05T14:19:20.000636 | Sirena | pythondev_help_Sirena_2017-10-05T14:19:20.000636 | 1,507,213,160.000636 | 96,073 |
pythondev | help | Alrighty, after all the laundry I've been avoiding and the grocey shopping, I'll dig into git and pycharm and CLIgit and check it out from there. | 2017-10-05T14:20:16.000096 | Seema | pythondev_help_Seema_2017-10-05T14:20:16.000096 | 1,507,213,216.000096 | 96,074 |
pythondev | help | :thumbsup: git 4 lyfe | 2017-10-05T14:20:53.000468 | Mallie | pythondev_help_Mallie_2017-10-05T14:20:53.000468 | 1,507,213,253.000468 | 96,075 |
pythondev | help | And remember, if you're friends don't use git, tell them they are wrong everyday :trollface: | 2017-10-05T14:21:11.000441 | Mallie | pythondev_help_Mallie_2017-10-05T14:21:11.000441 | 1,507,213,271.000441 | 96,076 |
pythondev | help | Umm...okay, "Joshua says you are wrong". :wink: | 2017-10-05T14:21:50.000645 | Seema | pythondev_help_Seema_2017-10-05T14:21:50.000645 | 1,507,213,310.000645 | 96,077 |
pythondev | help | Nah, the Internet or Hacker News says that lol | 2017-10-05T14:22:10.000511 | Mallie | pythondev_help_Mallie_2017-10-05T14:22:10.000511 | 1,507,213,330.000511 | 96,078 |
pythondev | help | ya dang kids, some of us had to do VC before git | 2017-10-05T14:23:07.000387 | Patty | pythondev_help_Patty_2017-10-05T14:23:07.000387 | 1,507,213,387.000387 | 96,079 |
pythondev | help | I've already concluded that I PyCharm + git is not the way I'm going. | 2017-10-05T14:23:09.000035 | Seema | pythondev_help_Seema_2017-10-05T14:23:09.000035 | 1,507,213,389.000035 | 96,080 |
pythondev | help | now get off my lawn | 2017-10-05T14:23:10.000561 | Patty | pythondev_help_Patty_2017-10-05T14:23:10.000561 | 1,507,213,390.000561 | 96,081 |
pythondev | help | <@Seema> would you say it's more PyCharm you're not going to use, or more git? | 2017-10-05T14:23:52.000400 | Sirena | pythondev_help_Sirena_2017-10-05T14:23:52.000400 | 1,507,213,432.0004 | 96,082 |
pythondev | help | The act of learning the concepts of git and the workflow and then adding a layer of PyCharm learning how to do the things seems to muddy the waters from the first 5 minutes of video watching and post reading. I don't know in the future but for the learning CLI only now. | 2017-10-05T14:25:24.000305 | Seema | pythondev_help_Seema_2017-10-05T14:25:24.000305 | 1,507,213,524.000305 | 96,083 |
pythondev | help | <@Patty> <https://github.com/git/git/commit/e83c5163316f89bfbde7d9ab23ca2e25604af290#comments> | 2017-10-05T14:25:30.000145 | Mallie | pythondev_help_Mallie_2017-10-05T14:25:30.000145 | 1,507,213,530.000145 | 96,084 |
pythondev | help | committed by Linus Torvalds Apr7, 2005 | 2017-10-05T14:26:25.000327 | Seema | pythondev_help_Seema_2017-10-05T14:26:25.000327 | 1,507,213,585.000327 | 96,085 |
pythondev | help | best README ever | 2017-10-05T14:26:43.000352 | Patty | pythondev_help_Patty_2017-10-05T14:26:43.000352 | 1,507,213,603.000352 | 96,086 |
pythondev | help | Also <@Seema> the workflow and concepts of git are going to be the same whether they are CLI or in PyCharm | 2017-10-05T14:27:21.000555 | Patty | pythondev_help_Patty_2017-10-05T14:27:21.000555 | 1,507,213,641.000555 | 96,087 |
pythondev | help | <@Patty> I get that but the layer of abstraction is a button or interface I would be "learning" and I can come back to the later (or not). The tutorials all have that click here, click there on how to use git in PyCharm. | 2017-10-05T14:29:02.000284 | Seema | pythondev_help_Seema_2017-10-05T14:29:02.000284 | 1,507,213,742.000284 | 96,088 |
pythondev | help | It’s just clicks vs. commands. A lot of the naming overlaps as well. In my experience most people get frustrated and move to CLI, which is used more, and has a lot more resources online | 2017-10-05T14:30:46.000460 | Patty | pythondev_help_Patty_2017-10-05T14:30:46.000460 | 1,507,213,846.00046 | 96,089 |
pythondev | help | so...you're suggesting that learning git through PyCharm will not be "noisy"? | 2017-10-05T14:31:24.000732 | Seema | pythondev_help_Seema_2017-10-05T14:31:24.000732 | 1,507,213,884.000732 | 96,090 |
pythondev | help | some things are harder to do than with CLI. personally what i’ve seen from my students was ditching something in a program for CLI so that they are interacting with git a bit more “closely” and it lends to better understanding/learning. It also makes things difficult if you are on a machine without PyCharm | 2017-10-05T14:33:30.000654 | Patty | pythondev_help_Patty_2017-10-05T14:33:30.000654 | 1,507,214,010.000654 | 96,091 |
pythondev | help | I’ve found that CLI + a GUI tool like SourceTree (if you are a visual person and like to see state of a repo that way) works best | 2017-10-05T14:33:55.000440 | Patty | pythondev_help_Patty_2017-10-05T14:33:55.000440 | 1,507,214,035.00044 | 96,092 |
pythondev | help | yeah, a GUI tool of some kind is important | 2017-10-05T14:35:02.000158 | Sirena | pythondev_help_Sirena_2017-10-05T14:35:02.000158 | 1,507,214,102.000158 | 96,093 |
pythondev | help | depends on the learner and the goals. some people go into SourceTree and then lean on it for a longgg time | 2017-10-05T14:35:44.000132 | Patty | pythondev_help_Patty_2017-10-05T14:35:44.000132 | 1,507,214,144.000132 | 96,094 |
pythondev | help | I think git ships with a tool called `gitk` which will provide a minimal GUI | 2017-10-05T14:35:58.000034 | Sirena | pythondev_help_Sirena_2017-10-05T14:35:58.000034 | 1,507,214,158.000034 | 96,095 |
pythondev | help | at least in most common packages for git | 2017-10-05T14:36:34.000418 | Sirena | pythondev_help_Sirena_2017-10-05T14:36:34.000418 | 1,507,214,194.000418 | 96,096 |
pythondev | help | different packages | 2017-10-05T14:36:59.000154 | Patty | pythondev_help_Patty_2017-10-05T14:36:59.000154 | 1,507,214,219.000154 | 96,097 |
pythondev | help | I don't use a GUI for git day-to-day, and the only ones I ever have were github/gitlab, but everyone is different | 2017-10-05T14:37:31.000139 | Mallie | pythondev_help_Mallie_2017-10-05T14:37:31.000139 | 1,507,214,251.000139 | 96,098 |
pythondev | help | <@Seema>, I wrote a Git tutorial for me and my friends a while ago. I found most of the documentation online to shallow or to deep. Perhaps it resonates with you:
<https://sentheon.com/blog/easy-git-guide-and-reference-for-the-busy.html> | 2017-10-05T14:37:40.000476 | Kym | pythondev_help_Kym_2017-10-05T14:37:40.000476 | 1,507,214,260.000476 | 96,099 |
pythondev | help | <@Kym> :taco: | 2017-10-05T14:38:00.000096 | Seema | pythondev_help_Seema_2017-10-05T14:38:00.000096 | 1,507,214,280.000096 | 96,100 |
pythondev | help | off to lunch, laundry, learn, thanks for resource | 2017-10-05T14:38:35.000657 | Seema | pythondev_help_Seema_2017-10-05T14:38:35.000657 | 1,507,214,315.000657 | 96,101 |
pythondev | help | So I'm falling victim to copying code from SO without understanding how it works. I have this ranking function:
```
def get_ranks(item, dictionary, reverse):
dictionary_sorted = sorted(dictionary.items(), key=lambda item: item[1], reverse=reverse)
rank, count, previous, result = 0, 0, None, {}
for key, num in dictionary_sorted:
count += 1
if num != previous:
rank += count
previous = num
count = 0
result[key] = rank
return result[item]
```
I have 1,013 key, value pairs in my dictionary. 698 of them have a value of 100 so they should all be ranked #1, then the next non-100 value should be ranked 699. Instead, they're all ranked 698th. Any idea how to get the starting rank at #1 when they're all the same? | 2017-10-05T15:08:31.000021 | Dominick | pythondev_help_Dominick_2017-10-05T15:08:31.000021 | 1,507,216,111.000021 | 96,102 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.