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 | I ended up adding a count | 2019-03-24T15:32:29.585500 | Mana | pythondev_help_Mana_2019-03-24T15:32:29.585500 | 1,553,441,549.5855 | 14,821 |
pythondev | help | next time put it in the code | 2019-03-24T15:32:32.585600 | Rodrick | pythondev_help_Rodrick_2019-03-24T15:32:32.585600 | 1,553,441,552.5856 | 14,822 |
pythondev | help | None | 2019-03-24T15:32:45.586000 | Rodrick | pythondev_help_Rodrick_2019-03-24T15:32:45.586000 | 1,553,441,565.586 | 14,823 |
pythondev | help | Thanks <@Rodrick> I’m kinda new here | 2019-03-24T15:34:00.587300 | Mana | pythondev_help_Mana_2019-03-24T15:34:00.587300 | 1,553,441,640.5873 | 14,824 |
pythondev | help | <https://get.slack.help/hc/en-us/articles/202288908-Format-your-messages#inline-code> | 2019-03-24T15:34:24.587500 | Hiroko | pythondev_help_Hiroko_2019-03-24T15:34:24.587500 | 1,553,441,664.5875 | 14,825 |
pythondev | help | No prob <@Mana> | 2019-03-24T15:35:00.587900 | Rodrick | pythondev_help_Rodrick_2019-03-24T15:35:00.587900 | 1,553,441,700.5879 | 14,826 |
pythondev | help | I will give you a taco :taco: | 2019-03-24T15:44:36.589100 | Rodrick | pythondev_help_Rodrick_2019-03-24T15:44:36.589100 | 1,553,442,276.5891 | 14,827 |
pythondev | help | haha | 2019-03-24T15:44:37.589200 | Rodrick | pythondev_help_Rodrick_2019-03-24T15:44:37.589200 | 1,553,442,277.5892 | 14,828 |
pythondev | help | <@Mana> :taco: | 2019-03-24T15:44:59.589600 | Rodrick | pythondev_help_Rodrick_2019-03-24T15:44:59.589600 | 1,553,442,299.5896 | 14,829 |
pythondev | help | :joy::joy: thanks bro | 2019-03-24T15:53:23.589900 | Mana | pythondev_help_Mana_2019-03-24T15:53:23.589900 | 1,553,442,803.5899 | 14,830 |
pythondev | help | ```n = int(input("enter number :")
count = 0
x = 2
while x <= n//2:
if (n%x) == 0:
count += 1
break
i += 1
If count == 0 and n! = 1:
print(n, "is not prime")
else:
print(n, " is prime")```
| 2019-03-24T15:53:31.590100 | Mana | pythondev_help_Mana_2019-03-24T15:53:31.590100 | 1,553,442,811.5901 | 14,831 |
pythondev | help | Yea that would work | 2019-03-24T15:55:24.590500 | Rodrick | pythondev_help_Rodrick_2019-03-24T15:55:24.590500 | 1,553,442,924.5905 | 14,832 |
pythondev | help | I think you have your final logic backwards. A positive value of `count` means that you found a divisor, so the number is composite. | 2019-03-24T15:56:21.591200 | Sasha | pythondev_help_Sasha_2019-03-24T15:56:21.591200 | 1,553,442,981.5912 | 14,833 |
pythondev | help | But I tried it and it worked | 2019-03-24T15:58:39.591800 | Mana | pythondev_help_Mana_2019-03-24T15:58:39.591800 | 1,553,443,119.5918 | 14,834 |
pythondev | help | "the code doesn't work: don't know why" | 2019-03-24T15:59:11.592300 | Rodrick | pythondev_help_Rodrick_2019-03-24T15:59:11.592300 | 1,553,443,151.5923 | 14,835 |
pythondev | help | "The code does work: don't know why" | 2019-03-24T15:59:29.592800 | Rodrick | pythondev_help_Rodrick_2019-03-24T15:59:29.592800 | 1,553,443,169.5928 | 14,836 |
pythondev | help | :thinking_face: | 2019-03-24T16:00:20.593000 | Mana | pythondev_help_Mana_2019-03-24T16:00:20.593000 | 1,553,443,220.593 | 14,837 |
pythondev | help | Can you copy-paste some sample output? | 2019-03-24T16:01:45.593500 | Sasha | pythondev_help_Sasha_2019-03-24T16:01:45.593500 | 1,553,443,305.5935 | 14,838 |
pythondev | help | There may also be some differences in what you're running and what you posted here. For instance, the use of `x` versus `i`, the capitalized `If`, etc. So maybe the print logic was accidentally reversed. | 2019-03-24T16:03:39.594700 | Sasha | pythondev_help_Sasha_2019-03-24T16:03:39.594700 | 1,553,443,419.5947 | 14,839 |
pythondev | help | Yeah I agree it I made mistake by make the ```if``` capital | 2019-03-24T16:05:49.596000 | Mana | pythondev_help_Mana_2019-03-24T16:05:49.596000 | 1,553,443,549.596 | 14,840 |
pythondev | help | I agree I made* | 2019-03-24T16:06:22.596600 | Mana | pythondev_help_Mana_2019-03-24T16:06:22.596600 | 1,553,443,582.5966 | 14,841 |
pythondev | help | <@Sasha> n = int(input("enter number :")
count = 0
x = 2
while x <= n//2:
if (n%x) == 0:
count += 1
break
i += 1
If count == 0 and n! = 1:
print(n, "is not prime")
else:
print(n, " is prime")
| 2019-03-24T16:08:43.597200 | Mana | pythondev_help_Mana_2019-03-24T16:08:43.597200 | 1,553,443,723.5972 | 14,842 |
pythondev | help | I don't know what to tell you. The code you're posting cannot run correctly, so if you're getting correct results in your environment, I can only assume that there's some differences somewhere. Are you copy-pasting or retyping it here? | 2019-03-24T16:13:26.598700 | Sasha | pythondev_help_Sasha_2019-03-24T16:13:26.598700 | 1,553,444,006.5987 | 14,843 |
pythondev | help | I’m sorry if I’m bothering you man:joy: but how about this | 2019-03-24T16:15:25.599900 | Mana | pythondev_help_Mana_2019-03-24T16:15:25.599900 | 1,553,444,125.5999 | 14,844 |
pythondev | help | ```n = int(input("enter number :")
count = 0
x= 2
while x <= n//2:
if (n%x) == 0:
count += 1
break
x += 1
If count == 0 and n! = 1:
print(n, "is not prime")
else:
print(n, " is prime")```
| 2019-03-24T16:17:19.601000 | Mana | pythondev_help_Mana_2019-03-24T16:17:19.601000 | 1,553,444,239.601 | 14,845 |
pythondev | help | still wrong? | 2019-03-24T16:17:49.601400 | Mana | pythondev_help_Mana_2019-03-24T16:17:49.601400 | 1,553,444,269.6014 | 14,846 |
pythondev | help | You've still got that capital `If`, so that won't run as posted. And if you fix that and run it with different inputs, it will say that 4 is prime and 5 is not prime. | 2019-03-24T16:20:33.602900 | Sasha | pythondev_help_Sasha_2019-03-24T16:20:33.602900 | 1,553,444,433.6029 | 14,847 |
pythondev | help | ```n = int(input("enter number :")
count = 0
x = 2
while x <= n//2:
if (n%x) == 0:
count += 1
break
x += 1
if count == 0 and n != 1:
print(n, "is prime")
else:
print(n, " is not prime")```
| 2019-03-24T16:25:39.603100 | Mana | pythondev_help_Mana_2019-03-24T16:25:39.603100 | 1,553,444,739.6031 | 14,848 |
pythondev | help | Great. That should work, as far as I can tell. | 2019-03-24T16:26:45.603500 | Sasha | pythondev_help_Sasha_2019-03-24T16:26:45.603500 | 1,553,444,805.6035 | 14,849 |
pythondev | help | :sweat_smile::sweat_smile::sweat_smile: finally | 2019-03-24T16:27:31.603900 | Mana | pythondev_help_Mana_2019-03-24T16:27:31.603900 | 1,553,444,851.6039 | 14,850 |
pythondev | help | I appreciate your help <@Sasha> :taco: | 2019-03-24T16:28:59.605000 | Mana | pythondev_help_Mana_2019-03-24T16:28:59.605000 | 1,553,444,939.605 | 14,851 |
pythondev | help | I'm very new to Python. Could anyone review this code and offer suggestions on how to improve (and why). Timeout handling is on my todo list. Eventually I'll turn this into a scheduled AWS lambda job to retrieve price info daily for a simple portfolio tracker. | 2019-03-24T16:50:32.606300 | Arcelia | pythondev_help_Arcelia_2019-03-24T16:50:32.606300 | 1,553,446,232.6063 | 14,852 |
pythondev | help | <@Arcelia> I think you can omit the div prefix. | 2019-03-24T16:51:23.607000 | Lean | pythondev_help_Lean_2019-03-24T16:51:23.607000 | 1,553,446,283.607 | 14,853 |
pythondev | help | Yes, still works :slightly_smiling_face: | 2019-03-24T16:54:10.609400 | Arcelia | pythondev_help_Arcelia_2019-03-24T16:54:10.609400 | 1,553,446,450.6094 | 14,854 |
pythondev | help | Other nitpicks and ideas:
- Add an entrypoint function e.g `main()`
- Add `if __name__ = "__main__" ` to invoke this by CLI or as a lib.
- If using latest Python, consider using data classes for `MorningstarLocators`
- Consider modeling the `MorningstarParser` after the Page Object Model. Instead of `MorningstarParser` , `MorningstarFundsPage`. | 2019-03-24T16:56:53.611000 | Lean | pythondev_help_Lean_2019-03-24T16:56:53.611000 | 1,553,446,613.611 | 14,855 |
pythondev | help | Great suggestions! Will have to google most of the suggestions but excited to learn :slightly_smiling_face: | 2019-03-24T16:59:30.612500 | Arcelia | pythondev_help_Arcelia_2019-03-24T16:59:30.612500 | 1,553,446,770.6125 | 14,856 |
pythondev | help | Hey Guys if you want to test your python skills and just want to make fun projects
go to <http://classroom.google.com|classroom.google.com> and click the plus button, then type in the code "3vhral" to be a part of the class
It will be one problem a week | 2019-03-24T19:12:13.613300 | Rodrick | pythondev_help_Rodrick_2019-03-24T19:12:13.613300 | 1,553,454,733.6133 | 14,857 |
pythondev | help | Its really cool | 2019-03-24T19:12:20.613500 | Rodrick | pythondev_help_Rodrick_2019-03-24T19:12:20.613500 | 1,553,454,740.6135 | 14,858 |
pythondev | help | I’m using scrapy to extract data by Xpath from a website but,
It return a empty array back
here the Xpath: /div[contains(@class, 'col-md-4 col-sm-6')][1]/div[contains(@class, 'result-wrapper')]/a[contains(@class, 'result algolia-clearfix')]/
here the website if that can help(<https://www.flightclub.com/catalogsearch/result/?q=378037-117>) | 2019-03-24T19:53:51.613800 | Izetta | pythondev_help_Izetta_2019-03-24T19:53:51.613800 | 1,553,457,231.6138 | 14,859 |
pythondev | help | are you sure the item is not populated by API request? | 2019-03-24T19:55:04.614300 | Hiroko | pythondev_help_Hiroko_2019-03-24T19:55:04.614300 | 1,553,457,304.6143 | 14,860 |
pythondev | help | that said, don’t think we can help you, since you’re in direct violation of that website’s tems of service | 2019-03-24T19:56:52.615300 | Hiroko | pythondev_help_Hiroko_2019-03-24T19:56:52.615300 | 1,553,457,412.6153 | 14,861 |
pythondev | help | <https://www.flightclub.com/terms-conditions> | 2019-03-24T19:56:55.615500 | Hiroko | pythondev_help_Hiroko_2019-03-24T19:56:55.615500 | 1,553,457,415.6155 | 14,862 |
pythondev | help | >>>• Use any robot, spider, script, or any manual or automated application or means to extract, download, retrieve, index, mine, scrape, reproduce, or circumvent the presentation, operation, or intended use of any feature, function, or part of the Site;
• Modify, adapt, translate, reverse engineer, decompile, or disassemble any portion of the Site;
• Copy, download, distribute, transmit, upload, or transfer content from the Site or the personal information of others without our prior written permission or authorization; | 2019-03-24T19:57:43.616400 | Hiroko | pythondev_help_Hiroko_2019-03-24T19:57:43.616400 | 1,553,457,463.6164 | 14,863 |
pythondev | help | eek | 2019-03-24T19:59:31.618400 | Rodrick | pythondev_help_Rodrick_2019-03-24T19:59:31.618400 | 1,553,457,571.6184 | 14,864 |
pythondev | help | Wow, I didn’t even look at the term and condition, I’m just doing this for fun, sorry | 2019-03-24T19:59:32.618500 | Izetta | pythondev_help_Izetta_2019-03-24T19:59:32.618500 | 1,553,457,572.6185 | 14,865 |
pythondev | help | Always read the terms and conditions | 2019-03-24T19:59:46.618800 | Rodrick | pythondev_help_Rodrick_2019-03-24T19:59:46.618800 | 1,553,457,586.6188 | 14,866 |
pythondev | help | Sorry, first time | 2019-03-24T20:00:25.619200 | Izetta | pythondev_help_Izetta_2019-03-24T20:00:25.619200 | 1,553,457,625.6192 | 14,867 |
pythondev | help | But, if anyone want to help me please do:joy: | 2019-03-24T20:01:39.620000 | Izetta | pythondev_help_Izetta_2019-03-24T20:01:39.620000 | 1,553,457,699.62 | 14,868 |
pythondev | help | What are you trying to do? | 2019-03-24T20:02:34.620300 | Rodrick | pythondev_help_Rodrick_2019-03-24T20:02:34.620300 | 1,553,457,754.6203 | 14,869 |
pythondev | help | trying to get the url of the shoe | 2019-03-24T20:04:01.621000 | Izetta | pythondev_help_Izetta_2019-03-24T20:04:01.621000 | 1,553,457,841.621 | 14,870 |
pythondev | help | hmmmm let me think | 2019-03-24T20:05:52.621200 | Rodrick | pythondev_help_Rodrick_2019-03-24T20:05:52.621200 | 1,553,457,952.6212 | 14,871 |
pythondev | help | Ok | 2019-03-24T20:06:08.621400 | Izetta | pythondev_help_Izetta_2019-03-24T20:06:08.621400 | 1,553,457,968.6214 | 14,872 |
pythondev | help | hey guys, I've got one *hell* of an issue! | 2019-03-25T01:11:52.622200 | Lita | pythondev_help_Lita_2019-03-25T01:11:52.622200 | 1,553,476,312.6222 | 14,873 |
pythondev | help | Since you've been silent for over 10 minutes instead of describing your issue, I'll guess that the problem is a broken keyboard. Fortunately they're super-cheap, so it's often better just to buy a new one instead of trying to fix a bad one. :smiley: | 2019-03-25T01:23:23.624200 | Sasha | pythondev_help_Sasha_2019-03-25T01:23:23.624200 | 1,553,477,003.6242 | 14,874 |
pythondev | help | I was just waiting or someone to see if they were there. | 2019-03-25T01:28:09.624700 | Lita | pythondev_help_Lita_2019-03-25T01:28:09.624700 | 1,553,477,289.6247 | 14,875 |
pythondev | help | but mostly `python -v` is broken | 2019-03-25T01:28:19.625000 | Lita | pythondev_help_Lita_2019-03-25T01:28:19.625000 | 1,553,477,299.625 | 14,876 |
pythondev | help | I think I'm going to reformat my raspbian image and start again. | 2019-03-25T01:29:14.625700 | Lita | pythondev_help_Lita_2019-03-25T01:29:14.625700 | 1,553,477,354.6257 | 14,877 |
pythondev | help | Hi, can anyone tell me how safe are python libraries available on cond and pypi? | 2019-03-25T02:19:58.627300 | Monnie | pythondev_help_Monnie_2019-03-25T02:19:58.627300 | 1,553,480,398.6273 | 14,878 |
pythondev | help | I'm not familiar with cond, but pypi ought to be pretty safe, especially for packages which have been around for a while. | 2019-03-25T02:25:23.628100 | Sasha | pythondev_help_Sasha_2019-03-25T02:25:23.628100 | 1,553,480,723.6281 | 14,879 |
pythondev | help | That said, it's not foolproof. There have been some malicious libraries on PyPI, and I don't think there's an audit process for new uploads. | 2019-03-25T02:30:28.628900 | Sasha | pythondev_help_Sasha_2019-03-25T02:30:28.628900 | 1,553,481,028.6289 | 14,880 |
pythondev | help | <@Sasha> i was talking about "conda" | 2019-03-25T02:36:40.629500 | Monnie | pythondev_help_Monnie_2019-03-25T02:36:40.629500 | 1,553,481,400.6295 | 14,881 |
pythondev | help | Gotcha. I presume that would be pretty safe too, but I don't actually know where conda pulls its packages from. | 2019-03-25T02:41:20.630200 | Sasha | pythondev_help_Sasha_2019-03-25T02:41:20.630200 | 1,553,481,680.6302 | 14,882 |
pythondev | help | hmm, strange. i was wondering how big organizations are using python and managing this issue | 2019-03-25T02:55:16.631600 | Monnie | pythondev_help_Monnie_2019-03-25T02:55:16.631600 | 1,553,482,516.6316 | 14,883 |
pythondev | help | When I was at Google, we needed to go through a somewhat involved process to get third-party libraries pulled into the company repo where they could be used in projects. That included licensing checks, security audits, etc. Typically they'd come directly from source instead of from package distributor sites. | 2019-03-25T02:58:58.633900 | Sasha | pythondev_help_Sasha_2019-03-25T02:58:58.633900 | 1,553,482,738.6339 | 14,884 |
pythondev | help | That meant that versions available were often behind what was available externally. | 2019-03-25T02:59:40.634500 | Sasha | pythondev_help_Sasha_2019-03-25T02:59:40.634500 | 1,553,482,780.6345 | 14,885 |
pythondev | help | And sometimes there would be some reinvention of the wheel where it was easier to rewrite simple libraries instead of get them approved. | 2019-03-25T03:00:32.635400 | Sasha | pythondev_help_Sasha_2019-03-25T03:00:32.635400 | 1,553,482,832.6354 | 14,886 |
pythondev | help | I think then it would be better to use Anaconda repository instead, since its maintained by Continuum | 2019-03-25T03:10:24.637000 | Monnie | pythondev_help_Monnie_2019-03-25T03:10:24.637000 | 1,553,483,424.637 | 14,887 |
pythondev | help | Well played! | 2019-03-25T07:25:38.638300 | Rodrick | pythondev_help_Rodrick_2019-03-25T07:25:38.638300 | 1,553,498,738.6383 | 14,888 |
pythondev | help | I hope PyPI at least uses Bandit at minimum | 2019-03-25T11:55:53.639600 | Granville | pythondev_help_Granville_2019-03-25T11:55:53.639600 | 1,553,514,953.6396 | 14,889 |
pythondev | help | PyPI is a clearinghouse - it takes anything that is a python package, no analysis done. They _do_ have a security policy and contact list, but that is for the security of PyPI, not packages on it | 2019-03-25T12:03:17.640700 | Clemmie | pythondev_help_Clemmie_2019-03-25T12:03:17.640700 | 1,553,515,397.6407 | 14,890 |
pythondev | help | ugh, that's a rude awakening | 2019-03-25T12:22:33.641000 | Granville | pythondev_help_Granville_2019-03-25T12:22:33.641000 | 1,553,516,553.641 | 14,891 |
pythondev | help | same for npm, maven central, etc ¯\_(ツ)_/¯ | 2019-03-25T12:25:18.641100 | Hiroko | pythondev_help_Hiroko_2019-03-25T12:25:18.641100 | 1,553,516,718.6411 | 14,892 |
pythondev | help | you need to evaluate packages you install | 2019-03-25T12:27:37.641500 | Jonas | pythondev_help_Jonas_2019-03-25T12:27:37.641500 | 1,553,516,857.6415 | 14,893 |
pythondev | help | same as anything. | 2019-03-25T12:27:52.642000 | Jonas | pythondev_help_Jonas_2019-03-25T12:27:52.642000 | 1,553,516,872.642 | 14,894 |
pythondev | help | is there a way to append multiple items at once? I hate out ugly it gets having to type list.append over and over | 2019-03-25T12:30:24.642900 | Nenita | pythondev_help_Nenita_2019-03-25T12:30:24.642900 | 1,553,517,024.6429 | 14,895 |
pythondev | help | `list.extend(iterable)` | 2019-03-25T12:30:33.643100 | Jonas | pythondev_help_Jonas_2019-03-25T12:30:33.643100 | 1,553,517,033.6431 | 14,896 |
pythondev | help | thx | 2019-03-25T12:30:47.643400 | Nenita | pythondev_help_Nenita_2019-03-25T12:30:47.643400 | 1,553,517,047.6434 | 14,897 |
pythondev | help | it's more efficient as well. | 2019-03-25T12:31:20.643600 | Jonas | pythondev_help_Jonas_2019-03-25T12:31:20.643600 | 1,553,517,080.6436 | 14,898 |
pythondev | help | It it more efficient enough to do `x.extend([y])` in place of `append()` or is it better than some n calls of `append()`? | 2019-03-25T12:32:24.644700 | Clemmie | pythondev_help_Clemmie_2019-03-25T12:32:24.644700 | 1,553,517,144.6447 | 14,899 |
pythondev | help | if you have `ipython` installed this is a good thing to test. | 2019-03-25T12:33:02.645200 | Jonas | pythondev_help_Jonas_2019-03-25T12:33:02.645200 | 1,553,517,182.6452 | 14,900 |
pythondev | help | No, `x.extend([y])` will be a lot slower | 2019-03-25T12:33:14.645600 | Jonas | pythondev_help_Jonas_2019-03-25T12:33:14.645600 | 1,553,517,194.6456 | 14,901 |
pythondev | help | Ok, the world is right again :wink: | 2019-03-25T12:33:48.646300 | Clemmie | pythondev_help_Clemmie_2019-03-25T12:33:48.646300 | 1,553,517,228.6463 | 14,902 |
pythondev | help | ```In [4]: %timeit [].extend([1])
130 ns ± 8.26 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)
In [5]: %timeit [].append(1)
76.1 ns ± 1.6 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)
``` | 2019-03-25T12:34:04.646500 | Jonas | pythondev_help_Jonas_2019-03-25T12:34:04.646500 | 1,553,517,244.6465 | 14,903 |
pythondev | help | I don’t have ipython in right now, but that is actually closer than I would have though | 2019-03-25T12:35:54.647100 | Clemmie | pythondev_help_Clemmie_2019-03-25T12:35:54.647100 | 1,553,517,354.6471 | 14,904 |
pythondev | help | I expect due to growing the list allocation, so extend catches up fairly quickly | 2019-03-25T12:36:23.647600 | Clemmie | pythondev_help_Clemmie_2019-03-25T12:36:23.647600 | 1,553,517,383.6476 | 14,905 |
pythondev | help | ```In [12]: %timeit x = []; x.append(1); x.append(2)
125 ns ± 1 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)
In [13]: to_extend = [1, 2]
In [14]: %timeit x = []; x.extend(to_extend)
98.5 ns ± 0.464 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)``` | 2019-03-25T12:36:46.647800 | Jonas | pythondev_help_Jonas_2019-03-25T12:36:46.647800 | 1,553,517,406.6478 | 14,906 |
pythondev | help | extend is better when you are extending anything more than 1 elements | 2019-03-25T12:37:14.648400 | Jonas | pythondev_help_Jonas_2019-03-25T12:37:14.648400 | 1,553,517,434.6484 | 14,907 |
pythondev | help | but doing `x.extend([1, 2])` has overhead, as it's allocating a list with two elements and then extending. | 2019-03-25T12:37:35.649000 | Jonas | pythondev_help_Jonas_2019-03-25T12:37:35.649000 | 1,553,517,455.649 | 14,908 |
pythondev | help | So your milage may vary | 2019-03-25T12:37:38.649200 | Jonas | pythondev_help_Jonas_2019-03-25T12:37:38.649200 | 1,553,517,458.6492 | 14,909 |
pythondev | help | counter-intuitively, `x.extend(iterable)` can be slower than `x.extend(list(iterable))` | 2019-03-25T12:37:59.649700 | Jonas | pythondev_help_Jonas_2019-03-25T12:37:59.649700 | 1,553,517,479.6497 | 14,910 |
pythondev | help | as with the second case the length of the extension is *known* beforehand, whereas with the first it can be any length. So python grows the list dynamically | 2019-03-25T12:38:25.650500 | Jonas | pythondev_help_Jonas_2019-03-25T12:38:25.650500 | 1,553,517,505.6505 | 14,911 |
pythondev | help | well, the `list` call has a defined length | 2019-03-25T12:38:32.651000 | Clemmie | pythondev_help_Clemmie_2019-03-25T12:38:32.651000 | 1,553,517,512.651 | 14,912 |
pythondev | help | which has added overhead | 2019-03-25T12:38:34.651100 | Jonas | pythondev_help_Jonas_2019-03-25T12:38:34.651100 | 1,553,517,514.6511 | 14,913 |
pythondev | help | makes sense | 2019-03-25T12:38:59.651300 | Clemmie | pythondev_help_Clemmie_2019-03-25T12:38:59.651300 | 1,553,517,539.6513 | 14,914 |
pythondev | help | to me it doesn't, as you're allocating a list with an unknown length anyway | 2019-03-25T12:39:18.651600 | Jonas | pythondev_help_Jonas_2019-03-25T12:39:18.651600 | 1,553,517,558.6516 | 14,915 |
pythondev | help | `list(iterable)` still suffers from the issue, as it's grown dynamically | 2019-03-25T12:39:32.652000 | Jonas | pythondev_help_Jonas_2019-03-25T12:39:32.652000 | 1,553,517,572.652 | 14,916 |
pythondev | help | so `x.extend(list(iterable))` is senseless. But it's faster, so :shrug: | 2019-03-25T12:39:46.652400 | Jonas | pythondev_help_Jonas_2019-03-25T12:39:46.652400 | 1,553,517,586.6524 | 14,917 |
pythondev | help | ah, good point. I’ll have to take a look at the implementation of `extend`. | 2019-03-25T12:40:26.653100 | Clemmie | pythondev_help_Clemmie_2019-03-25T12:40:26.653100 | 1,553,517,626.6531 | 14,918 |
pythondev | help | Its probably simpler that way than having `extend` inspect the type | 2019-03-25T12:40:57.653700 | Clemmie | pythondev_help_Clemmie_2019-03-25T12:40:57.653700 | 1,553,517,657.6537 | 14,919 |
pythondev | help | I'd suggest that you use whatever is easier to read, since anything else is premature micro-optimisation. :stuck_out_tongue_winking_eye: | 2019-03-25T12:50:15.654700 | Melynda | pythondev_help_Melynda_2019-03-25T12:50:15.654700 | 1,553,518,215.6547 | 14,920 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.