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
thank you all for your help
2017-10-19T06:54:04.000336
Ronald
pythondev_help_Ronald_2017-10-19T06:54:04.000336
1,508,396,044.000336
97,403
pythondev
help
my code is up and running :slightly_smiling_face:
2017-10-19T06:54:09.000234
Ronald
pythondev_help_Ronald_2017-10-19T06:54:09.000234
1,508,396,049.000234
97,404
pythondev
help
<@Collette> - thanks for suggestions. have some followup questions though: 1. example? I want a fixture that sets up some Server and then test it - either by providing a fresh Server instance to every test (function scope) or by reusing the same Server for a bunch of tests (class scope) - the Server setting up fixture is the same - the usage is different. my idea was to have: ``` @pytest.fixture(scope='function') def server_for_single_test(): return Server() @pytest.fixture(scope='class') def server_for_tests_in_class(): return Server() ``` but this feels rather redundant, no? 2. regarding the pytest shared session fixture suggestion... wouldn't this mean i'd need to have every fixture define it in it's args? ``` def fixture_a(request, shared_state, ...): pass ``` no way to avoid this? feels like autouse wouldn't fit here as i need access to the shared_state instance somehow
2017-10-19T08:10:01.000172
Arlean
pythondev_help_Arlean_2017-10-19T08:10:01.000172
1,508,400,601.000172
97,405
pythondev
help
<@Arlean> 1. Yeah, I got what you meant. But _why_ do you need this? What problem you're trying to solve with that? 2. Yes. Just like you'll need `request` fixture requested in every single test
2017-10-19T08:15:24.000157
Collette
pythondev_help_Collette_2017-10-19T08:15:24.000157
1,508,400,924.000157
97,406
pythondev
help
<@Collette> it is not really a problem, more a constraint. * the Server I'm testing takes a while to bring up and configure, so I would like to minimize this time during tests and have multiple tests run against same Server * on the other hand, some tests are more destructive than others and might affect other tests if they run against the same Server - so I would like to have them run separately * in addition, would like to have the option to decide on which way to run from command line flag and not for example forcing all tests be in classes even if they are classes of single test hope this makes sense
2017-10-19T08:22:13.000282
Arlean
pythondev_help_Arlean_2017-10-19T08:22:13.000282
1,508,401,333.000282
97,407
pythondev
help
oh, and for 2. there is a workaround: ``` import pytest ... def some_test_or_fixture(request): assert pytest.config == request.config ``` so i do not *have* to pass request just for some shared data
2017-10-19T08:24:30.000175
Arlean
pythondev_help_Arlean_2017-10-19T08:24:30.000175
1,508,401,470.000175
97,408
pythondev
help
Alright. I'd put these two kinds of tests into separate folders, with different fixtures, and run them like `pytest tests/shared` and `pytest tests/destructive`
2017-10-19T08:26:22.000115
Collette
pythondev_help_Collette_2017-10-19T08:26:22.000115
1,508,401,582.000115
97,409
pythondev
help
To me a cli switch is not enough when doing destructive things. I think you have to be explicit about what you're doing, and it's better to minimize the possibility of running a wrong suite
2017-10-19T08:27:24.000420
Collette
pythondev_help_Collette_2017-10-19T08:27:24.000420
1,508,401,644.00042
97,410
pythondev
help
Anyway, I'd go with two different fixtures
2017-10-19T08:30:01.000241
Collette
pythondev_help_Collette_2017-10-19T08:30:01.000241
1,508,401,801.000241
97,411
pythondev
help
ok, I'm glad I was in the same basic direction with defining different fixtures for this thanks :slightly_smiling_face: :+1:
2017-10-19T08:31:27.000002
Arlean
pythondev_help_Arlean_2017-10-19T08:31:27.000002
1,508,401,887.000002
97,412
pythondev
help
I currently have a colour enum that has a predefined set of standard colours however rarely a custom colour is given that isn't defined in the enum is it possible for the enum to have an else clause?
2017-10-19T08:44:18.000551
Winnie
pythondev_help_Winnie_2017-10-19T08:44:18.000551
1,508,402,658.000551
97,413
pythondev
help
So that it can also hold the custom given colour?
2017-10-19T08:45:00.000014
Winnie
pythondev_help_Winnie_2017-10-19T08:45:00.000014
1,508,402,700.000014
97,414
pythondev
help
Is there any function in Sklearn that plots the learning curve of a model in terms of Ein-sample and Evalidation?
2017-10-19T09:22:47.000445
Christin
pythondev_help_Christin_2017-10-19T09:22:47.000445
1,508,404,967.000445
97,415
pythondev
help
The default one uses score or accuracy i think
2017-10-19T09:23:05.000239
Christin
pythondev_help_Christin_2017-10-19T09:23:05.000239
1,508,404,985.000239
97,416
pythondev
help
I have list of dictionaries like this ``` [ {'DBSnapshotIdentifier': 'rds-beta-api-manual-2017-10-15-215632', 'SnapshotCreateTime': datetime.datetime(2017, 10, 15, 21, 56, 52, 558000, tzinfo=tzutc()), 'Status': 'available'}, {'DBSnapshotIdentifier': 'rds-beta-api-manual-2017-10-16-074817', 'SnapshotCreateTime': datetime.datetime(2017, 10, 16, 7, 48, 48, 646000, tzinfo=tzutc()), 'Status': 'available'}, {'DBSnapshotIdentifier': 'rds-beta-api-manual-2017-10-16-190649', 'SnapshotCreateTime': datetime.datetime(2017, 10, 16, 19, 7, 14, 164000, tzinfo=tzutc()), 'Status': 'available'}, {'DBSnapshotIdentifier': 'rds-beta-api-manual-2017-10-17-070650', 'SnapshotCreateTime': datetime.datetime(2017, 10, 17, 7, 7, 20, 880000, tzinfo=tzutc()), 'Status': 'available'} ] ``` How can I make sure that I have this list always sorted based on `SnapshotCreateTime`(ignoring the fact that this list is already sorted)?
2017-10-19T10:02:10.000337
Gabrielle
pythondev_help_Gabrielle_2017-10-19T10:02:10.000337
1,508,407,330.000337
97,417
pythondev
help
you can use a heapq
2017-10-19T10:03:24.000130
Winnie
pythondev_help_Winnie_2017-10-19T10:03:24.000130
1,508,407,404.00013
97,418
pythondev
help
as long as you treat it like a stack
2017-10-19T10:03:57.000087
Winnie
pythondev_help_Winnie_2017-10-19T10:03:57.000087
1,508,407,437.000087
97,419
pythondev
help
```from operator import itemgetter sorted_list = sorted(list_of_dicts, key = itemgetter('SnapshotCreateTime)) ```
2017-10-19T10:04:25.000314
Meg
pythondev_help_Meg_2017-10-19T10:04:25.000314
1,508,407,465.000314
97,420
pythondev
help
<@Meg> but he always wants it sorted
2017-10-19T10:04:52.000031
Winnie
pythondev_help_Winnie_2017-10-19T10:04:52.000031
1,508,407,492.000031
97,421
pythondev
help
<@Winnie> my bad, would want this list to be sorted after all the insertions (dicts) have happened
2017-10-19T10:05:34.000095
Gabrielle
pythondev_help_Gabrielle_2017-10-19T10:05:34.000095
1,508,407,534.000095
97,422
pythondev
help
ok, so my method would work
2017-10-19T10:05:44.000514
Meg
pythondev_help_Meg_2017-10-19T10:05:44.000514
1,508,407,544.000514
97,423
pythondev
help
<@Gabrielle> with a heap, it will auto sort as you insert
2017-10-19T10:06:05.000189
Winnie
pythondev_help_Winnie_2017-10-19T10:06:05.000189
1,508,407,565.000189
97,424
pythondev
help
<@Winnie>’s would work if you needed some sort of rolling, always-available stack
2017-10-19T10:06:08.000272
Meg
pythondev_help_Meg_2017-10-19T10:06:08.000272
1,508,407,568.000272
97,425
pythondev
help
<@Meg> let me try it out. <@Winnie> will look it up. Thanks :slightly_smiling_face:
2017-10-19T10:07:05.000201
Gabrielle
pythondev_help_Gabrielle_2017-10-19T10:07:05.000201
1,508,407,625.000201
97,426
pythondev
help
<@Meg> woyld you know what to do with my problem :stuck_out_tongue:
2017-10-19T10:07:48.000205
Winnie
pythondev_help_Winnie_2017-10-19T10:07:48.000205
1,508,407,668.000205
97,427
pythondev
help
this q on SO might help
2017-10-19T10:09:51.000195
Meg
pythondev_help_Meg_2017-10-19T10:09:51.000195
1,508,407,791.000195
97,428
pythondev
help
<https://stackoverflow.com/questions/29795488/how-to-test-if-an-enum-member-with-a-certain-name-exists>
2017-10-19T10:09:52.000004
Meg
pythondev_help_Meg_2017-10-19T10:09:52.000004
1,508,407,792.000004
97,429
pythondev
help
<@Winnie> Can you give more details about what you're trying to do/what the ideal use case would look like for you?
2017-10-19T10:15:57.000714
Antionette
pythondev_help_Antionette_2017-10-19T10:15:57.000714
1,508,408,157.000714
97,430
pythondev
help
the current project I'm working on uses an Enum to store a set of default colours
2017-10-19T10:16:33.000739
Winnie
pythondev_help_Winnie_2017-10-19T10:16:33.000739
1,508,408,193.000739
97,431
pythondev
help
however this was a bad design decision because colours can also be customised
2017-10-19T10:16:54.000221
Winnie
pythondev_help_Winnie_2017-10-19T10:16:54.000221
1,508,408,214.000221
97,432
pythondev
help
and so now I've run into that issue where a Colour Enum was tried to be created but couldn't because it wasn't pre-defined
2017-10-19T10:17:58.000410
Winnie
pythondev_help_Winnie_2017-10-19T10:17:58.000410
1,508,408,278.00041
97,433
pythondev
help
is ther esome way to define a custom element in an enum to hold any colour?
2017-10-19T10:18:28.000558
Winnie
pythondev_help_Winnie_2017-10-19T10:18:28.000558
1,508,408,308.000558
97,434
pythondev
help
``` &gt;&gt;&gt; from enum import Enum &gt;&gt;&gt; class Color(Enum): ... RED = 1 ... GREEN = 2 ... BLUE = 3 &gt;&gt;&gt; Color(RED) Color.RED &gt;&gt;&gt; Color(BLACK) Color.CUSTOM
2017-10-19T10:20:14.000324
Winnie
pythondev_help_Winnie_2017-10-19T10:20:14.000324
1,508,408,414.000324
97,435
pythondev
help
where CUSTOM can be dynamically changed? or just that any non-existant key maps to a pre-existing CUSTOM?
2017-10-19T10:21:07.000484
Antionette
pythondev_help_Antionette_2017-10-19T10:21:07.000484
1,508,408,467.000484
97,436
pythondev
help
if the first I don't think that's possible with Enum
2017-10-19T10:21:49.000428
Antionette
pythondev_help_Antionette_2017-10-19T10:21:49.000428
1,508,408,509.000428
97,437
pythondev
help
wait let me edit that
2017-10-19T10:22:06.000696
Winnie
pythondev_help_Winnie_2017-10-19T10:22:06.000696
1,508,408,526.000696
97,438
pythondev
help
``` &gt;&gt;&gt; from enum import Enum &gt;&gt;&gt; class Color(Enum): ... RED = 1 ... GREEN = 2 ... BLUE = 3 &gt;&gt;&gt; Color(RED) Color.RED &gt;&gt;&gt; Color(1) Color.RED &gt;&gt;&gt; Color(1).value 1 &gt;&gt;&gt; Color(4) Color.CUSTOM &gt;&gt;&gt; Color(4).value 4 ```
2017-10-19T10:23:06.000122
Winnie
pythondev_help_Winnie_2017-10-19T10:23:06.000122
1,508,408,586.000122
97,439
pythondev
help
<@Antionette>
2017-10-19T10:23:24.000691
Winnie
pythondev_help_Winnie_2017-10-19T10:23:24.000691
1,508,408,604.000691
97,440
pythondev
help
How many customs do you want to be able to have?
2017-10-19T10:25:26.000393
Meghan
pythondev_help_Meghan_2017-10-19T10:25:26.000393
1,508,408,726.000393
97,441
pythondev
help
for every possible colour
2017-10-19T10:25:45.000580
Winnie
pythondev_help_Winnie_2017-10-19T10:25:45.000580
1,508,408,745.00058
97,442
pythondev
help
So the code using this then goes something like `if Color.RED: color_value = '#ff0000'`
2017-10-19T10:28:26.000820
Meghan
pythondev_help_Meghan_2017-10-19T10:28:26.000820
1,508,408,906.00082
97,443
pythondev
help
?
2017-10-19T10:28:28.000746
Meghan
pythondev_help_Meghan_2017-10-19T10:28:28.000746
1,508,408,908.000746
97,444
pythondev
help
more correclty the code is ``` class ThreadColor(Enum): """Used to specify a thread colors""" MESSENGER_BLUE = '' VIKING = '#44bec7' GOLDEN_POPPY = '#ffc300' RADICAL_RED = '#fa3c4c' ``` And tries to make a color given a user string ``` return ThreadColor( '#44bec7') ```
2017-10-19T10:30:09.000228
Winnie
pythondev_help_Winnie_2017-10-19T10:30:09.000228
1,508,409,009.000228
97,445
pythondev
help
but now I need it to be able to work for any hex string
2017-10-19T10:30:30.000127
Winnie
pythondev_help_Winnie_2017-10-19T10:30:30.000127
1,508,409,030.000127
97,446
pythondev
help
Sounds like maybe instead of an enum you'd be better with a dictionary
2017-10-19T10:33:56.000559
Sirena
pythondev_help_Sirena_2017-10-19T10:33:56.000559
1,508,409,236.000559
97,447
pythondev
help
Yes, absolutely should be a dictionary, but that depends on how much code needs rewritten.
2017-10-19T10:34:15.000897
Meghan
pythondev_help_Meghan_2017-10-19T10:34:15.000897
1,508,409,255.000897
97,448
pythondev
help
not much, but it just wouldn't be backwards compatible
2017-10-19T10:34:57.000100
Winnie
pythondev_help_Winnie_2017-10-19T10:34:57.000100
1,508,409,297.0001
97,449
pythondev
help
From the linked SO post, why not `try/except` if you have to use Enum?
2017-10-19T10:35:01.000330
Scot
pythondev_help_Scot_2017-10-19T10:35:01.000330
1,508,409,301.00033
97,450
pythondev
help
<@Scot> well I can do ``` try: return ThreadColor(string) except ValueError: return ...? ```
2017-10-19T10:36:20.000644
Winnie
pythondev_help_Winnie_2017-10-19T10:36:20.000644
1,508,409,380.000644
97,451
pythondev
help
<https://stackoverflow.com/questions/28126314/adding-members-to-python-enums>
2017-10-19T10:40:24.000299
Meghan
pythondev_help_Meghan_2017-10-19T10:40:24.000299
1,508,409,624.000299
97,452
pythondev
help
There are two reasonable options there. Either an advanced enum written by the author of the enum library, or redefine the enum. I was working on a third option before I hit a bit of a snag.
2017-10-19T10:40:55.000464
Meghan
pythondev_help_Meghan_2017-10-19T10:40:55.000464
1,508,409,655.000464
97,453
pythondev
help
Where I am so far: ``` class Color(Enum): RED = 1 GREEN = 2 BLUE = 3 def add_custom(self, name, value): pass pprint(Color.__dict__) Color.__dict__['_member_map_']['PURPLE'] = 5 Color.__dict__['_member_names_'].append('PURPLE') Color.__dict__['_value2member_map_'][5] = Color.PURPLE pprint(Color.__dict__) mappingproxy({'BLUE': &lt;Color.BLUE: 3&gt;, 'GREEN': &lt;Color.GREEN: 2&gt;, 'RED': &lt;Color.RED: 1&gt;, '__doc__': 'An enumeration.', '__module__': '__main__', '__new__': &lt;function Enum.__new__ at 0x02372A08&gt;, '_generate_next_value_': &lt;function Enum._generate_next_value_ at 0x02372A50&gt;, '_member_map_': OrderedDict([('RED', &lt;Color.RED: 1&gt;), ('GREEN', &lt;Color.GREEN: 2&gt;), ('BLUE', &lt;Color.BLUE: 3&gt;), ('PURPLE', 5)]), '_member_names_': ['RED', 'GREEN', 'BLUE', 'PURPLE'], '_member_type_': &lt;class 'object'&gt;, '_value2member_map_': {1: &lt;Color.RED: 1&gt;, 2: &lt;Color.GREEN: 2&gt;, 3: &lt;Color.BLUE: 3&gt;, 5: 5}, 'add_custom': &lt;function Color.add_custom at 0x0238D738&gt;}) ```
2017-10-19T10:41:36.000315
Meghan
pythondev_help_Meghan_2017-10-19T10:41:36.000315
1,508,409,696.000315
97,454
pythondev
help
Someone's told me that Sum Types are what should be used for this but They're not really a thing in python
2017-10-19T10:46:19.000284
Winnie
pythondev_help_Winnie_2017-10-19T10:46:19.000284
1,508,409,979.000284
97,455
pythondev
help
<@Winnie> I'd vote for refactoring
2017-10-19T10:47:01.000090
Collette
pythondev_help_Collette_2017-10-19T10:47:01.000090
1,508,410,021.00009
97,456
pythondev
help
You can't preserve backwards compatibility forever using these kinds of hacks
2017-10-19T10:47:53.000524
Collette
pythondev_help_Collette_2017-10-19T10:47:53.000524
1,508,410,073.000524
97,457
pythondev
help
And since you don't have much code to change yet, it's better to break everything now than later
2017-10-19T10:48:13.000040
Collette
pythondev_help_Collette_2017-10-19T10:48:13.000040
1,508,410,093.00004
97,458
pythondev
help
<@Collette> yeah I'd agree I just wanted to see if there was anything possible to oncsider first
2017-10-19T10:49:43.000177
Winnie
pythondev_help_Winnie_2017-10-19T10:49:43.000177
1,508,410,183.000177
97,459
pythondev
help
Even if that is technically possible, I don't see how that would fit the mental model of enums
2017-10-19T10:50:40.000464
Collette
pythondev_help_Collette_2017-10-19T10:50:40.000464
1,508,410,240.000464
97,460
pythondev
help
So why would a dictionary make more sense?
2017-10-19T10:51:42.000884
Winnie
pythondev_help_Winnie_2017-10-19T10:51:42.000884
1,508,410,302.000884
97,461
pythondev
help
Did you look at the SO post I shared? It can be done with the aenum library.
2017-10-19T10:51:54.000406
Meghan
pythondev_help_Meghan_2017-10-19T10:51:54.000406
1,508,410,314.000406
97,462
pythondev
help
Because you can add to a dictionary as you go and can address it by key.
2017-10-19T10:52:08.000110
Meghan
pythondev_help_Meghan_2017-10-19T10:52:08.000110
1,508,410,328.00011
97,463
pythondev
help
but I don't really need to address it by key It's just a unified structure to store a colour which could just be a string instead.
2017-10-19T10:53:10.000105
Winnie
pythondev_help_Winnie_2017-10-19T10:53:10.000105
1,508,410,390.000105
97,464
pythondev
help
<@Meghan> I did look at the link, What wouldn't make sense is what the name should be when you add a new one in
2017-10-19T10:55:08.000287
Winnie
pythondev_help_Winnie_2017-10-19T10:55:08.000287
1,508,410,508.000287
97,465
pythondev
help
Should a custom given, non-existent color code result in it being stored under a unique ID for further use alongside other new custom colors?
2017-10-19T10:56:29.000372
Scot
pythondev_help_Scot_2017-10-19T10:56:29.000372
1,508,410,589.000372
97,466
pythondev
help
<@Winnie> it sounds like you need a mapping between color names and some sort of values. A dictionary can be used to implement such mapping very easy
2017-10-19T10:56:47.000046
Collette
pythondev_help_Collette_2017-10-19T10:56:47.000046
1,508,410,607.000046
97,467
pythondev
help
I came to Python from C/C++ so I tend to shy away from assigning real meaning to the value of an enum. Whether or not that is idiomatic in python I'm not sure, but I feel like it's a behavior that's unlikely to backfire on me. Dictionaries are meant to map from one piece of info to another which sounds more appropriate for your situation. Enums work best when they are compared with each other but not really used as substitute numbers or substitute strings. That's not to say it's the only way to use them, but it seems the most resilient way
2017-10-19T10:57:43.000792
Sirena
pythondev_help_Sirena_2017-10-19T10:57:43.000792
1,508,410,663.000792
97,468
pythondev
help
Yeah, once the value matters it should be a dict.
2017-10-19T10:58:25.000766
Meghan
pythondev_help_Meghan_2017-10-19T10:58:25.000766
1,508,410,705.000766
97,469
pythondev
help
well the thing is that there's only ever one reference to a colour name in the code I think an enum was used just because they thought an enum would suit the job
2017-10-19T10:59:00.000445
Winnie
pythondev_help_Winnie_2017-10-19T10:59:00.000445
1,508,410,740.000445
97,470
pythondev
help
and it did at the time, but now you want to extend it and it doesn't fit as well as it used to
2017-10-19T10:59:52.000137
Sirena
pythondev_help_Sirena_2017-10-19T10:59:52.000137
1,508,410,792.000137
97,471
pythondev
help
actually
2017-10-19T11:00:11.000812
Winnie
pythondev_help_Winnie_2017-10-19T11:00:11.000812
1,508,410,811.000812
97,472
pythondev
help
and you can still make it work if you really want, but it will involve a lot of branching depending on whether your enum is custom or not
2017-10-19T11:00:35.000848
Sirena
pythondev_help_Sirena_2017-10-19T11:00:35.000848
1,508,410,835.000848
97,473
pythondev
help
an enum kinda fits because the user should only be able to provide the given values in the enum
2017-10-19T11:00:43.000323
Winnie
pythondev_help_Winnie_2017-10-19T11:00:43.000323
1,508,410,843.000323
97,474
pythondev
help
why not reverse the key:value to value:key and run a dict lookup?
2017-10-19T11:03:00.000255
Scot
pythondev_help_Scot_2017-10-19T11:03:00.000255
1,508,410,980.000255
97,475
pythondev
help
<@Winnie> don't you think that contradicts to what you've said earlier?
2017-10-19T11:03:00.000554
Collette
pythondev_help_Collette_2017-10-19T11:03:00.000554
1,508,410,980.000554
97,476
pythondev
help
disclaimer: it's 2am here
2017-10-19T11:03:24.000443
Winnie
pythondev_help_Winnie_2017-10-19T11:03:24.000443
1,508,411,004.000443
97,477
pythondev
help
I'm confused, if the user only gets to use the provided values, why do you need custom at all?
2017-10-19T11:03:31.000124
Sirena
pythondev_help_Sirena_2017-10-19T11:03:31.000124
1,508,411,011.000124
97,478
pythondev
help
okay I think it might be easier to give the longer story so I'm working on the fbchat module, which interfaces with messenger messenger would allow you to configure colours given a set ammount but there was a point where you could just make a get request for any colour so now I have a facebook chat with a black chat bubble now fbchat attempts to read in the colour to its pre-defined enum but now, messenger has made it such that you can no longer make a get request with any colour
2017-10-19T11:06:17.001052
Winnie
pythondev_help_Winnie_2017-10-19T11:06:17.001052
1,508,411,177.001052
97,479
pythondev
help
so the module needs to be able to accept any colour from a chat but we need to tell users that only these colours in this enum can be actually sent
2017-10-19T11:07:12.000120
Winnie
pythondev_help_Winnie_2017-10-19T11:07:12.000120
1,508,411,232.00012
97,480
pythondev
help
so what I'm thinking is to re-factor such that on return of a colour, a string is given instead of a ThreadColor object, but on sending, a user must give a ThreadColor object
2017-10-19T11:08:08.000675
Winnie
pythondev_help_Winnie_2017-10-19T11:08:08.000675
1,508,411,288.000675
97,481
pythondev
help
so it gets the color options from messenger, and offers just those to the user?
2017-10-19T11:08:11.000026
Sirena
pythondev_help_Sirena_2017-10-19T11:08:11.000026
1,508,411,291.000026
97,482
pythondev
help
yes
2017-10-19T11:08:36.000264
Winnie
pythondev_help_Winnie_2017-10-19T11:08:36.000264
1,508,411,316.000264
97,483
pythondev
help
Are the colors documented?
2017-10-19T11:09:40.000795
Meghan
pythondev_help_Meghan_2017-10-19T11:09:40.000795
1,508,411,380.000795
97,484
pythondev
help
yes
2017-10-19T11:10:15.000312
Winnie
pythondev_help_Winnie_2017-10-19T11:10:15.000312
1,508,411,415.000312
97,485
pythondev
help
would it work to build a dict from the messenger data and then just catch a KeyError if the user gives something not in the dict?
2017-10-19T11:10:22.000461
Sirena
pythondev_help_Sirena_2017-10-19T11:10:22.000461
1,508,411,422.000461
97,486
pythondev
help
<https://fbchat.readthedocs.io/en/master/api.html#fbchat.models.ThreadColor>
2017-10-19T11:10:39.000364
Winnie
pythondev_help_Winnie_2017-10-19T11:10:39.000364
1,508,411,439.000364
97,487
pythondev
help
You really like enums
2017-10-19T11:11:54.000353
Collette
pythondev_help_Collette_2017-10-19T11:11:54.000353
1,508,411,514.000353
97,488
pythondev
help
This isn't my project
2017-10-19T11:12:15.000051
Winnie
pythondev_help_Winnie_2017-10-19T11:12:15.000051
1,508,411,535.000051
97,489
pythondev
help
I'm just contributing :stuck_out_tongue:
2017-10-19T11:12:25.000250
Winnie
pythondev_help_Winnie_2017-10-19T11:12:25.000250
1,508,411,545.00025
97,490
pythondev
help
This project really likes enums :slightly_smiling_face:
2017-10-19T11:12:59.000686
Collette
pythondev_help_Collette_2017-10-19T11:12:59.000686
1,508,411,579.000686
97,491
pythondev
help
yeah...
2017-10-19T11:13:09.000396
Winnie
pythondev_help_Winnie_2017-10-19T11:13:09.000396
1,508,411,589.000396
97,492
pythondev
help
<@Sirena> I think it makes more sense to give the user a datastructure that they have to use as opposed to let them send whatever they want but just fail them when they do it wrong
2017-10-19T11:13:23.000528
Winnie
pythondev_help_Winnie_2017-10-19T11:13:23.000528
1,508,411,603.000528
97,493
pythondev
help
Might be able to build off of something like this:
2017-10-19T11:14:04.000447
Antionette
pythondev_help_Antionette_2017-10-19T11:14:04.000447
1,508,411,644.000447
97,494
pythondev
help
if you can somehow find way to get val be a color instead of just the int
2017-10-19T11:15:34.000031
Antionette
pythondev_help_Antionette_2017-10-19T11:15:34.000031
1,508,411,734.000031
97,495
pythondev
help
<@Antionette> you'd just pass the string instead
2017-10-19T11:16:07.000074
Winnie
pythondev_help_Winnie_2017-10-19T11:16:07.000074
1,508,411,767.000074
97,496
pythondev
help
well I meant an instance of `Color`
2017-10-19T11:16:22.000219
Antionette
pythondev_help_Antionette_2017-10-19T11:16:22.000219
1,508,411,782.000219
97,497
pythondev
help
right now the newly added values are different from the values created when the Enum is instantiated
2017-10-19T11:16:41.000726
Antionette
pythondev_help_Antionette_2017-10-19T11:16:41.000726
1,508,411,801.000726
97,498
pythondev
help
howso
2017-10-19T11:16:59.000038
Winnie
pythondev_help_Winnie_2017-10-19T11:16:59.000038
1,508,411,819.000038
97,499
pythondev
help
ie in the example that gets printed Color(2) is Color.RED but Color(3) is Custom3 rather than Color.Custom3
2017-10-19T11:17:20.000808
Antionette
pythondev_help_Antionette_2017-10-19T11:17:20.000808
1,508,411,840.000808
97,500
pythondev
help
it points to just the name rather than a `Color` with the correct name
2017-10-19T11:17:38.000623
Antionette
pythondev_help_Antionette_2017-10-19T11:17:38.000623
1,508,411,858.000623
97,501
pythondev
help
right
2017-10-19T11:18:15.000151
Winnie
pythondev_help_Winnie_2017-10-19T11:18:15.000151
1,508,411,895.000151
97,502