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
so an generator runs sequentially till its exhausted
2019-04-11T16:13:15.259900
Hiroko
pythondev_help_Hiroko_2019-04-11T16:13:15.259900
1,554,999,195.2599
18,221
pythondev
help
and python is passed by reference when it comes to objects
2019-04-11T16:13:43.260500
Hiroko
pythondev_help_Hiroko_2019-04-11T16:13:43.260500
1,554,999,223.2605
18,222
pythondev
help
so you’re essentially making `grp2_copy` look at the same address location as `grp`
2019-04-11T16:14:04.261100
Hiroko
pythondev_help_Hiroko_2019-04-11T16:14:04.261100
1,554,999,244.2611
18,223
pythondev
help
you’d need to use `copy` or `deepcopy` to make a complete separate clone
2019-04-11T16:14:23.261500
Hiroko
pythondev_help_Hiroko_2019-04-11T16:14:23.261500
1,554,999,263.2615
18,224
pythondev
help
Ok so I did this and it works… ``` grp1, grp2 = tee(grp) temp_dict["salesTrans"] = sum(item["salesTrans"] for item in grp1) temp_dict["saleUnits"] = sum(item["saleUnits"] for item in grp2) ```
2019-04-11T16:15:38.262100
Kit
pythondev_help_Kit_2019-04-11T16:15:38.262100
1,554,999,338.2621
18,225
pythondev
help
<@Hiroko> yeah I was wondering about that right after I posted it. Is what I did acceptable or should I use copy?
2019-04-11T16:16:30.262900
Kit
pythondev_help_Kit_2019-04-11T16:16:30.262900
1,554,999,390.2629
18,226
pythondev
help
looks good to me!
2019-04-11T16:17:53.263100
Hiroko
pythondev_help_Hiroko_2019-04-11T16:17:53.263100
1,554,999,473.2631
18,227
pythondev
help
TIL `tee` is the go-to for copying generators
2019-04-11T16:18:03.263400
Hiroko
pythondev_help_Hiroko_2019-04-11T16:18:03.263400
1,554,999,483.2634
18,228
pythondev
help
sweet thanks guys
2019-04-11T16:18:23.263800
Kit
pythondev_help_Kit_2019-04-11T16:18:23.263800
1,554,999,503.2638
18,229
pythondev
help
Can someone tell me why in python 3 I could have a class which defined some instance variable `self.thing` and set it such that `self.thing = thing = some_class()` in `__init__`, I could then define a bunch of `init` local variables and some local function `my_func` inside of init, and set some callback on `thing` such that at some point in the future I could come back and run the function only defined within my `__init__`
2019-04-11T17:55:58.266200
Candra
pythondev_help_Candra_2019-04-11T17:55:58.266200
1,555,005,358.2662
18,230
pythondev
help
I know this is confusing and I apologize, I’m just confused on this behavior and why it doesn’t exist in python3 or why it did exist in python2
2019-04-11T17:56:25.266800
Candra
pythondev_help_Candra_2019-04-11T17:56:25.266800
1,555,005,385.2668
18,231
pythondev
help
Perhaps it would be instructive if you showed the code which is giving you an error and what the error is?
2019-04-11T18:04:43.267500
Sasha
pythondev_help_Sasha_2019-04-11T18:04:43.267500
1,555,005,883.2675
18,232
pythondev
help
Are you getting three random ints for the printed results output ? <https://github.com/paulgureghian/Secure_Multi_Party_Computation>
2019-04-11T18:08:58.268200
Clayton
pythondev_help_Clayton_2019-04-11T18:08:58.268200
1,555,006,138.2682
18,233
pythondev
help
<@Clayton> It looks like in `add()` and `product()` you're `return`ing inside the loop instead of after it completes.
2019-04-11T18:14:28.269000
Sasha
pythondev_help_Sasha_2019-04-11T18:14:28.269000
1,555,006,468.269
18,234
pythondev
help
So you'll only get 1 value out instead of 3.
2019-04-11T18:14:57.269300
Sasha
pythondev_help_Sasha_2019-04-11T18:14:57.269300
1,555,006,497.2693
18,235
pythondev
help
Ok. Thanks
2019-04-11T18:19:36.269800
Clayton
pythondev_help_Clayton_2019-04-11T18:19:36.269800
1,555,006,776.2698
18,236
pythondev
help
Hi all, For some reason a recent Homebrew update on my Mac (Mojave) got messed up and shat all over itself — I can no longer access Python 2.7, etc. I decided that I’d remove and reinstall Homebrew: get it back to system Python, and then reinstall Homebrew fresh atop a clean Mojave system Python. I uninstalled via the usual call to the uninstall script, which completed, but said that there was a problem with the Ruby environment manager, `rbenv`. Isn’t rbenv maintained by homebrew? Can I get away with removing rbenv too? Or even just by blowing away the dotfolder for it?
2019-04-11T18:40:32.270700
Vasiliki
pythondev_help_Vasiliki_2019-04-11T18:40:32.270700
1,555,008,032.2707
18,237
pythondev
help
Hello, I was a bit off-track of python for couple of years lets say. What is the best solution/package to maintain `requirements.txt` which will cover only needed packages for my app?
2019-04-11T20:21:44.272300
Sabrina
pythondev_help_Sabrina_2019-04-11T20:21:44.272300
1,555,014,104.2723
18,238
pythondev
help
i have become a pretty big fan of `pipenv` for managing python dependencies
2019-04-11T20:30:59.272700
Caridad
pythondev_help_Caridad_2019-04-11T20:30:59.272700
1,555,014,659.2727
18,239
pythondev
help
and really `pyenv`
2019-04-11T20:31:10.273000
Caridad
pythondev_help_Caridad_2019-04-11T20:31:10.273000
1,555,014,670.273
18,240
pythondev
help
thank for suggesting!
2019-04-11T21:39:08.000200
Cinda
pythondev_help_Cinda_2019-04-11T21:39:08.000200
1,555,018,748.0002
18,241
pythondev
help
Anyone used `<http://smee.io|smee.io>` for webhooks? Seems useful Just seeing if there is a better approach?
2019-04-11T22:54:05.001400
Annabell
pythondev_help_Annabell_2019-04-11T22:54:05.001400
1,555,023,245.0014
18,242
pythondev
help
I'm playing around with Google Functions and I want to pass a function I have deployed with a JSON file using http requests.
2019-04-12T00:15:53.002700
Conchita
pythondev_help_Conchita_2019-04-12T00:15:53.002700
1,555,028,153.0027
18,243
pythondev
help
Does anyone know the curl command for something like that?
2019-04-12T00:16:06.003100
Conchita
pythondev_help_Conchita_2019-04-12T00:16:06.003100
1,555,028,166.0031
18,244
pythondev
help
`curl "<https://SERVER-LOCATION-PROJECT-NAME.cloudfunctions.net/FUNCTION-NAME>" -H "Content-Type:application/json --...`
2019-04-12T00:17:11.003900
Conchita
pythondev_help_Conchita_2019-04-12T00:17:11.003900
1,555,028,231.0039
18,245
pythondev
help
This is what I have so far, but I'm not sure what to replace the `...` with to load the json file I have stored locally
2019-04-12T00:17:38.004600
Conchita
pythondev_help_Conchita_2019-04-12T00:17:38.004600
1,555,028,258.0046
18,246
pythondev
help
Any help will be appreciated
2019-04-12T00:17:44.004900
Conchita
pythondev_help_Conchita_2019-04-12T00:17:44.004900
1,555,028,264.0049
18,247
pythondev
help
You have to send to body if it is a post, right? <https://gist.github.com/subfuzion/08c5d85437d5d4f00e58#examples> `curl -d "param1=value1&amp;param2=value2" -H "Content-Type: application/x-www-form-urlencoded" -X POST <http://localhost:3000/data>`
2019-04-12T01:00:09.005400
Annabell
pythondev_help_Annabell_2019-04-12T01:00:09.005400
1,555,030,809.0054
18,248
pythondev
help
Hi, guys. I'm stuck on my first issue. I use a Raspberry Pi as a little web server to help me get to grips with Python, and to familiarize myself with general linux type syntax at the same time. I come from a Windows background, so i'm no pro at Linux at all. My issue is this : The Pi comes with Python 2.7 and Python 3.5 pre-installed. From what i can see "pip" is also installed by default, so... I have installed some flask packages ( modules ?? ) with pip install &lt;package&gt;, but unbeknownst to me, when i tried to import some flask modules using the Python3 interpreter ( think that's what you call it ), it complains that those packages cannot be imported as they don't "exist". My research led me to understand that pip installed the packages to the Python 2.7 site-packages folder instead of the site-packages for python3 ( as this is my default interpreter ). I verified that this was the case by running : pip show &lt;package name&gt; So my question is - how do i now move these packages from the Python 2.7 site-packages folder to the Python3 site-packages folder, and then force pip to install all future packages inside Python3's site-packages folder ? Thanks
2019-04-12T01:25:11.012700
Celinda
pythondev_help_Celinda_2019-04-12T01:25:11.012700
1,555,032,311.0127
18,249
pythondev
help
Thanks that sorted it out! Here's a <@Annabell> :taco:
2019-04-12T01:45:02.013900
Conchita
pythondev_help_Conchita_2019-04-12T01:45:02.013900
1,555,033,502.0139
18,250
pythondev
help
<@Celinda> The simplest way would be to install packages using `pip3`, like `pip3 install flask` If it gives you an error, saying that pip3 was not found, just try `sudo apt-get install python3-pip`
2019-04-12T01:51:20.015800
Virgil
pythondev_help_Virgil_2019-04-12T01:51:20.015800
1,555,033,880.0158
18,251
pythondev
help
thanks <@Virgil> - would i have to uninstall the other packages i mistakenly installed under 2.7 first ?
2019-04-12T01:52:44.016700
Celinda
pythondev_help_Celinda_2019-04-12T01:52:44.016700
1,555,033,964.0167
18,252
pythondev
help
You don't have to, they would not conflict with your Python3 packages. I would suggest you to use virtual environments instead of using global packages.
2019-04-12T01:54:01.018000
Virgil
pythondev_help_Virgil_2019-04-12T01:54:01.018000
1,555,034,041.018
18,253
pythondev
help
Yeah - I head about venv - I'll have to go read up on how to enable that. Thing is my web app is already built, so im not sure how to move all of it under a venv ?
2019-04-12T01:55:01.018900
Celinda
pythondev_help_Celinda_2019-04-12T01:55:01.018900
1,555,034,101.0189
18,254
pythondev
help
if you want to use python3, just install `sudo apt-get install python3-venv` and then inside your project directory or somewhere else (your preference) create a venv using `python3 -m venv &lt;any_name_for_venv&gt;` To activate the venv, `source '&lt;path_to_venv&gt;/bin/activate`
2019-04-12T01:57:12.020700
Virgil
pythondev_help_Virgil_2019-04-12T01:57:12.020700
1,555,034,232.0207
18,255
pythondev
help
after activating the venv, you can install specific packages inside that venv
2019-04-12T01:57:52.021500
Virgil
pythondev_help_Virgil_2019-04-12T01:57:52.021500
1,555,034,272.0215
18,256
pythondev
help
Thank you - also watched this video which was very helpful : <https://www.youtube.com/watch?v=N5vscPTWKOk>
2019-04-12T02:15:31.022000
Celinda
pythondev_help_Celinda_2019-04-12T02:15:31.022000
1,555,035,331.022
18,257
pythondev
help
Cool!
2019-04-12T02:16:38.022400
Virgil
pythondev_help_Virgil_2019-04-12T02:16:38.022400
1,555,035,398.0224
18,258
pythondev
help
OK great <@Virgil> ! - your command actually worked for me and the command in the video above didn't work for me ( maybe it's MAC only ). I think i understand how virtual environments work now. Its pretty neat !
2019-04-12T05:32:16.024700
Celinda
pythondev_help_Celinda_2019-04-12T05:32:16.024700
1,555,047,136.0247
18,259
pythondev
help
I'm playing with Google Functions and I one `main.py` script where I call this function ```def publish(): from functions import publish ``` Publish.py: ```import time from google.cloud import pubsub_v1 project_id = "test-project" topic_name = "test-topic" publisher = pubsub_v1.PublisherClient() topic_path = publisher.topic_path(project_id, topic_name) def callback(message_future): # When timeout is unspecified, the exception method waits indefinitely. if message_future.exception(timeout=30): print('Publishing message on {} threw an Exception {}.'.format( topic_name, message_future.exception())) else: print(message_future.result()) for n in range(1, 10): data = u'Message number {}'.format(n) # Data must be a bytestring data = data.encode('utf-8') # When you publish a message, the client returns a Future. message_future = publisher.publish(topic_path, data=data) message_future.add_done_callback(callback) print('Published message IDs:') # We must keep the main thread from exiting to allow it to process # messages in the background. while True: time.sleep(60)```
2019-04-12T05:45:45.026800
Conchita
pythondev_help_Conchita_2019-04-12T05:45:45.026800
1,555,047,945.0268
18,260
pythondev
help
I'm getting an error that says ```TypeError: publish() takes 0 positional arguments but 1 was given```
2019-04-12T05:46:24.027200
Conchita
pythondev_help_Conchita_2019-04-12T05:46:24.027200
1,555,047,984.0272
18,261
pythondev
help
Anyone see why I get this error message as I'm not passing any arg to `def publish()`?
2019-04-12T05:46:59.027800
Conchita
pythondev_help_Conchita_2019-04-12T05:46:59.027800
1,555,048,019.0278
18,262
pythondev
help
Can you post the code where you call `publish`?
2019-04-12T05:53:42.028200
Wilber
pythondev_help_Wilber_2019-04-12T05:53:42.028200
1,555,048,422.0282
18,263
pythondev
help
If its being called as a class method then it will be automatically passing the class instance as the first argument
2019-04-12T05:55:00.029100
Wilber
pythondev_help_Wilber_2019-04-12T05:55:00.029100
1,555,048,500.0291
18,264
pythondev
help
The first snippet above is where I call publish, the second snippet is the code of the whole publish.py script. Neither is using classes <@Wilber>
2019-04-12T05:57:50.030300
Conchita
pythondev_help_Conchita_2019-04-12T05:57:50.030300
1,555,048,670.0303
18,265
pythondev
help
Do you want the whole code from where I call the `publish.py`?
2019-04-12T05:59:01.031300
Conchita
pythondev_help_Conchita_2019-04-12T05:59:01.031300
1,555,048,741.0313
18,266
pythondev
help
yeah
2019-04-12T05:59:47.032100
Wilber
pythondev_help_Wilber_2019-04-12T05:59:47.032100
1,555,048,787.0321
18,267
pythondev
help
None
2019-04-12T06:01:05.032200
Conchita
pythondev_help_Conchita_2019-04-12T06:01:05.032200
1,555,048,865.0322
18,268
pythondev
help
(its a mess)
2019-04-12T06:01:12.032600
Conchita
pythondev_help_Conchita_2019-04-12T06:01:12.032600
1,555,048,872.0326
18,269
pythondev
help
Ah probably has to do with how google functions is calling it then? Sorry I'm not familiar with them. Does the error give a stack trace? You can also try adding an argument to your `publish` method and then logging it to see what its expecting
2019-04-12T06:06:41.034000
Wilber
pythondev_help_Wilber_2019-04-12T06:06:41.034000
1,555,049,201.034
18,270
pythondev
help
Yeah this stuff is a bit confusing. I'll try a few different approaches here
2019-04-12T06:12:56.034800
Conchita
pythondev_help_Conchita_2019-04-12T06:12:56.034800
1,555,049,576.0348
18,271
pythondev
help
Oh, my assumption is that when google functions is trying to run the function it always passes the `request` argument
2019-04-12T06:17:34.035400
Wilber
pythondev_help_Wilber_2019-04-12T06:17:34.035400
1,555,049,854.0354
18,272
pythondev
help
So you might need to define the publish function with that argument (like it is with `run`)
2019-04-12T06:18:25.035800
Wilber
pythondev_help_Wilber_2019-04-12T06:18:25.035800
1,555,049,905.0358
18,273
pythondev
help
Aha, gotcha!
2019-04-12T06:19:40.036000
Conchita
pythondev_help_Conchita_2019-04-12T06:19:40.036000
1,555,049,980.036
18,274
pythondev
help
That makes sense
2019-04-12T06:19:42.036300
Conchita
pythondev_help_Conchita_2019-04-12T06:19:42.036300
1,555,049,982.0363
18,275
pythondev
help
Ttying something now
2019-04-12T06:19:45.036600
Conchita
pythondev_help_Conchita_2019-04-12T06:19:45.036600
1,555,049,985.0366
18,276
pythondev
help
<@Celinda> what's your OS?
2019-04-12T07:35:43.037400
Erika
pythondev_help_Erika_2019-04-12T07:35:43.037400
1,555,054,543.0374
18,277
pythondev
help
I'm running on Debian ( Raspberry Pi 3b + ) - it's just used as a little web server so i can learn to write little web apps
2019-04-12T08:59:13.039100
Celinda
pythondev_help_Celinda_2019-04-12T08:59:13.039100
1,555,059,553.0391
18,278
pythondev
help
<@Javier>
2019-04-12T11:22:23.040100
Dayna
pythondev_help_Dayna_2019-04-12T11:22:23.040100
1,555,068,143.0401
18,279
pythondev
help
Right, hold on a second
2019-04-12T11:22:38.040600
Javier
pythondev_help_Javier_2019-04-12T11:22:38.040600
1,555,068,158.0406
18,280
pythondev
help
Can you share your actual problem you're trying to solve? Not how you want to solve it, what you want to solve (e.g. not the X/Y problem)
2019-04-12T11:22:54.041000
Dayna
pythondev_help_Dayna_2019-04-12T11:22:54.041000
1,555,068,174.041
18,281
pythondev
help
Glad to be of service.
2019-04-12T11:24:35.043500
Annabell
pythondev_help_Annabell_2019-04-12T11:24:35.043500
1,555,068,275.0435
18,282
pythondev
help
``` def enthusiastic_sort(value): if "-" in value: value = value.split ("-") alphabetic_length = len(value[1]) if alphabetic_length &gt; 0: number_of_zs = alphabetic_length -1 value[1] = (number_of_zs * "Z") + value [1][-1] characters = ''.join(values[1:]) alphabetic_to_numeric =\ convert_alphabetic_char_to_unicode(characters) value = float(value[0]) + sum(alphabetic_to_numeric) else: value = float(value) + 0.9199999999999999999999 return float(value) def convert_alphabetic_char_to_unicode(characters): return [put_unicode_in_correct_place(index, value) for index, value in\ enumerate(characters)] def put_unicode_in_correct_place(index, value): return ((ord(value) * (.1 ** ((int(index) * 2) + 2)))) ``` This sorts some values of of the form `['3331', '3331-A', '3331-B', '3331-AA', '3332', 'DRUGS']`. They numeric value should appear like you would expect to find them in excel. The words should appear at same position they would when sorting normally. Thee series of functions I've laid out cannot handle 'DRUGS'. They throw a ValueError. I'm trying you figure out the best way to handle DRUGS, and other strings that can't be converted to floats so I can sort them with enthusiastic_sort as key.
2019-04-12T11:45:01.068600
Javier
pythondev_help_Javier_2019-04-12T11:45:01.068600
1,555,069,501.0686
18,283
pythondev
help
<@Dayna> <@Clemmie> <@Hiroko> ^
2019-04-12T11:45:27.069100
Javier
pythondev_help_Javier_2019-04-12T11:45:27.069100
1,555,069,527.0691
18,284
pythondev
help
Please @ me I gotta make a bunch of phone calls. I figured it out
2019-04-12T11:47:28.069700
Javier
pythondev_help_Javier_2019-04-12T11:47:28.069700
1,555,069,648.0697
18,285
pythondev
help
Good to know, thanks!
2019-04-12T12:06:22.069800
Vasiliki
pythondev_help_Vasiliki_2019-04-12T12:06:22.069800
1,555,070,782.0698
18,286
pythondev
help
Anyone using Pycharm with Bitbucket and git?
2019-04-12T12:45:43.072100
Enid
pythondev_help_Enid_2019-04-12T12:45:43.072100
1,555,073,143.0721
18,287
pythondev
help
Hi, All module/package scope variable and global variables aren’t thread safe in Flask?
2019-04-12T13:11:47.072600
Cicely
pythondev_help_Cicely_2019-04-12T13:11:47.072600
1,555,074,707.0726
18,288
pythondev
help
I’m building a simple app with Flask, first came in my mind is about module/package variables. They aren’t like Go, where i can use mutex to make variables thread safe in concurrency.
2019-04-12T13:12:06.072800
Cicely
pythondev_help_Cicely_2019-04-12T13:12:06.072800
1,555,074,726.0728
18,289
pythondev
help
Yeah <@Enid>, in future please just ask a question rather than asking if anyone knows something about the question you want to ask
2019-04-12T13:13:07.074000
Jonas
pythondev_help_Jonas_2019-04-12T13:13:07.074000
1,555,074,787.074
18,290
pythondev
help
<@Jonas> Yup, that was dumb of me. I got sidetracked and hit enter. Has someone successfully pointed Pycharm to Bitbucket? I cannot get it to work. I can connect to Bitbucket with Git but with Pycharm,
2019-04-12T13:18:24.075600
Enid
pythondev_help_Enid_2019-04-12T13:18:24.075600
1,555,075,104.0756
18,291
pythondev
help
Are you looking for more than the git integration (meaning there is some deeper integration your are looking for)? It should just read your local git directory for changes/diffs/conflicts.
2019-04-12T13:21:06.076500
Dayna
pythondev_help_Dayna_2019-04-12T13:21:06.076500
1,555,075,266.0765
18,292
pythondev
help
There are some older issues on the JetBrains issue tracker about using non-RSA private keys: <https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000124604-PyCharm-Bitbucket-Could-not-read-from-remote-repository>
2019-04-12T13:22:11.077200
Dayna
pythondev_help_Dayna_2019-04-12T13:22:11.077200
1,555,075,331.0772
18,293
pythondev
help
<@Dayna> When I try to push from Pycharm nothing happens. If I push from Git bash things work.
2019-04-12T13:24:11.078200
Enid
pythondev_help_Enid_2019-04-12T13:24:11.078200
1,555,075,451.0782
18,294
pythondev
help
"nothing happens", can you find the logs? There should be some report if problem somewhere you can read
2019-04-12T13:24:32.078600
Dayna
pythondev_help_Dayna_2019-04-12T13:24:32.078600
1,555,075,472.0786
18,295
pythondev
help
I will check the logs. I might ping you later if I can get it to work. Thank you for the suggestion.
2019-04-12T13:29:43.079200
Enid
pythondev_help_Enid_2019-04-12T13:29:43.079200
1,555,075,783.0792
18,296
pythondev
help
why does this not work? It doesn't update the variables in the list?
2019-04-12T13:37:57.079300
Nenita
pythondev_help_Nenita_2019-04-12T13:37:57.079300
1,555,076,277.0793
18,297
pythondev
help
nope. It has to do with how python handles references and immutable objects
2019-04-12T13:40:12.080500
Clemmie
pythondev_help_Clemmie_2019-04-12T13:40:12.080500
1,555,076,412.0805
18,298
pythondev
help
but what are you really trying to do? - that is a toy example, and the real case may have a workable solution
2019-04-12T13:40:41.081000
Clemmie
pythondev_help_Clemmie_2019-04-12T13:40:41.081000
1,555,076,441.081
18,299
pythondev
help
Line 5 is equivalent to `my_list = ['', '', '']` because the list holds the contents of the variable, not the variable name.
2019-04-12T13:41:46.082100
Sasha
pythondev_help_Sasha_2019-04-12T13:41:46.082100
1,555,076,506.0821
18,300
pythondev
help
i have 12 headers that are variable names to store the values that will be appended in the latter portion. I made a list containing the variable names (not their values) which then store the values, but it doesn't seem to like this method.
2019-04-12T13:42:24.082900
Nenita
pythondev_help_Nenita_2019-04-12T13:42:24.082900
1,555,076,544.0829
18,301
pythondev
help
stick them into a single dict, change the values in the dict, and grab the changed values when needed
2019-04-12T13:42:59.083700
Clemmie
pythondev_help_Clemmie_2019-04-12T13:42:59.083700
1,555,076,579.0837
18,302
pythondev
help
so at anytime your list is a call to dict.values()
2019-04-12T13:44:13.085100
Clemmie
pythondev_help_Clemmie_2019-04-12T13:44:13.085100
1,555,076,653.0851
18,303
pythondev
help
<@Clemmie> that would work. thanks. <@Sasha> thanks for the info. that makes sense.
2019-04-12T13:44:13.085200
Nenita
pythondev_help_Nenita_2019-04-12T13:44:13.085200
1,555,076,653.0852
18,304
pythondev
help
i figured it would update the values in the list, but i guess not.
2019-04-12T13:44:32.085600
Nenita
pythondev_help_Nenita_2019-04-12T13:44:32.085600
1,555,076,672.0856
18,305
pythondev
help
when you find yourself doing something with a group of objects, you should think about using the container types
2019-04-12T13:45:48.086600
Clemmie
pythondev_help_Clemmie_2019-04-12T13:45:48.086600
1,555,076,748.0866
18,306
pythondev
help
container types being?: dictionary, lists, etc?
2019-04-12T13:48:05.087000
Nenita
pythondev_help_Nenita_2019-04-12T13:48:05.087000
1,555,076,885.087
18,307
pythondev
help
yup
2019-04-12T13:48:21.087200
Clemmie
pythondev_help_Clemmie_2019-04-12T13:48:21.087200
1,555,076,901.0872
18,308
pythondev
help
:thumbsup:
2019-04-12T13:48:30.087400
Nenita
pythondev_help_Nenita_2019-04-12T13:48:30.087400
1,555,076,910.0874
18,309
pythondev
help
<https://docs.python.org/3/library/collections.html>
2019-04-12T13:48:41.087600
Clemmie
pythondev_help_Clemmie_2019-04-12T13:48:41.087600
1,555,076,921.0876
18,310
pythondev
help
those are special ones, but calls out the general purpose ones in the first line
2019-04-12T13:48:56.088000
Clemmie
pythondev_help_Clemmie_2019-04-12T13:48:56.088000
1,555,076,936.088
18,311
pythondev
help
per that link - random question here - but i saw 'if key in mapping'. Does the keyword 'in' work like enumerate or like a dictionary pointer(dict[key])?
2019-04-12T13:52:01.089600
Nenita
pythondev_help_Nenita_2019-04-12T13:52:01.089600
1,555,077,121.0896
18,312
pythondev
help
that formula asks “is the value held by `key` in the iterable `mapping`
2019-04-12T13:58:49.091300
Clemmie
pythondev_help_Clemmie_2019-04-12T13:58:49.091300
1,555,077,529.0913
18,313
pythondev
help
i see
2019-04-12T13:59:45.092100
Nenita
pythondev_help_Nenita_2019-04-12T13:59:45.092100
1,555,077,585.0921
18,314
pythondev
help
The behavior can vary depending on what `mapping` is. If it's an iterable, it'll loop through and see whether one of the values is equal to `key`. If it's a dict, it will directly see whether `key` is one of the keys in the dict.
2019-04-12T14:00:04.092700
Sasha
pythondev_help_Sasha_2019-04-12T14:00:04.092700
1,555,077,604.0927
18,315
pythondev
help
ah thanks. that definitely clears the fog up
2019-04-12T14:00:33.093200
Nenita
pythondev_help_Nenita_2019-04-12T14:00:33.093200
1,555,077,633.0932
18,316
pythondev
help
(And sets are in the middle... it'll directly see whether one of the set values is `key`, without needing to iterate.)
2019-04-12T14:02:25.094100
Sasha
pythondev_help_Sasha_2019-04-12T14:02:25.094100
1,555,077,745.0941
18,317
pythondev
help
thats nice
2019-04-12T14:03:23.094400
Nenita
pythondev_help_Nenita_2019-04-12T14:03:23.094400
1,555,077,803.0944
18,318
pythondev
help
yeah- i hand waved over a dict returning the iterable of keys -sorry
2019-04-12T14:09:31.094800
Clemmie
pythondev_help_Clemmie_2019-04-12T14:09:31.094800
1,555,078,171.0948
18,319
pythondev
help
Hey guys! What do you think are the advantages/disadvantages of adding this to a setup.py? do you think that is a good practice? ``` with open('requirements.txt') as f: requirements = f.read().splitlines() setup( name='package name', version='version', install_requires=requirements, ... ) ``` The goal is to avoid duplication
2019-04-12T14:16:51.095000
Winfred
pythondev_help_Winfred_2019-04-12T14:16:51.095000
1,555,078,611.095
18,320