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 | Hey guys, I'm trying to run Docker (with a Debian image) on a Mac. My Python installation on Mac has case-sensitive imports but not in Docker, and this is breaking the `queue` module which has both `queue` and `Queue`. I'm guessing the Python build on Mac deals with Mac having case-insensitive file system but in Docker it's a Debian build so it doesn't, but because Docker is using case-insensitive file system, it causes issue. Is there any way around this? | 2017-07-11T11:11:28.262003 | Margy | pythondev_help_Margy_2017-07-11T11:11:28.262003 | 1,499,771,488.262003 | 84,703 |
pythondev | help | <@Kiersten> <@Beula> The issue is that I want to pass the field name to a generic function so it can be used to filter on any field name. <https://github.com/TomFaulkner/pypihole/blob/master/pypihole/pypihole.py> See the counts_client and _counts_generic functions. (line 62 and 69-70 in particular)
I do access the namedtuple with the entry.client and such wherever possible, of course. But, I don't think that is possible here. | 2017-07-11T11:13:11.328113 | Meghan | pythondev_help_Meghan_2017-07-11T11:13:11.328113 | 1,499,771,591.328113 | 84,704 |
pythondev | help | <@Gabriele> <@Beula> Thanks, I'll think about what exactly it is I'm doing. I think manual versioning is the way to go for now, and ignore tagging commits. | 2017-07-11T11:16:31.459538 | Tami | pythondev_help_Tami_2017-07-11T11:16:31.459538 | 1,499,771,791.459538 | 84,705 |
pythondev | help | I do tag commits... it's just a manual process for me, or facilitated with git-flow or whatever | 2017-07-11T11:17:48.509968 | Gabriele | pythondev_help_Gabriele_2017-07-11T11:17:48.509968 | 1,499,771,868.509968 | 84,706 |
pythondev | help | General question, that came up in the TestPodcast slack group: what preferred docstring format do people use? reStructuredText, Google, etc? | 2017-07-11T12:06:04.437572 | Beula | pythondev_help_Beula_2017-07-11T12:06:04.437572 | 1,499,774,764.437572 | 84,707 |
pythondev | help | reStructeredText here but i have used google and numpy before | 2017-07-11T12:06:29.453610 | Johana | pythondev_help_Johana_2017-07-11T12:06:29.453610 | 1,499,774,789.45361 | 84,708 |
pythondev | help | numpy is really nice to use when having to make ML researchers document their code. | 2017-07-11T12:06:59.473440 | Johana | pythondev_help_Johana_2017-07-11T12:06:59.473440 | 1,499,774,819.47344 | 84,709 |
pythondev | help | <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt> | 2017-07-11T12:07:48.504384 | Johana | pythondev_help_Johana_2017-07-11T12:07:48.504384 | 1,499,774,868.504384 | 84,710 |
pythondev | help | interesting | 2017-07-11T12:08:36.533898 | Beula | pythondev_help_Beula_2017-07-11T12:08:36.533898 | 1,499,774,916.533898 | 84,711 |
pythondev | help | I do the default pycharm (reStructuredText) too | 2017-07-11T12:08:50.542055 | Beula | pythondev_help_Beula_2017-07-11T12:08:50.542055 | 1,499,774,930.542055 | 84,712 |
pythondev | help | Shouldn't the math.pow arguments be the other way around? | 2017-07-11T12:21:59.017692 | Gabriele | pythondev_help_Gabriele_2017-07-11T12:21:59.017692 | 1,499,775,719.017692 | 84,713 |
pythondev | help | Also: <https://pypi.python.org/pypi/backoff/1.4.0> | 2017-07-11T12:22:03.020447 | Gabriele | pythondev_help_Gabriele_2017-07-11T12:22:03.020447 | 1,499,775,723.020447 | 84,714 |
pythondev | help | That packaged didn't work for me because I am yielding a generator and need the state vs just re-calling the function | 2017-07-11T12:22:35.039412 | Beula | pythondev_help_Beula_2017-07-11T12:22:35.039412 | 1,499,775,755.039412 | 84,715 |
pythondev | help | aha | 2017-07-11T12:22:46.045755 | Gabriele | pythondev_help_Gabriele_2017-07-11T12:22:46.045755 | 1,499,775,766.045755 | 84,716 |
pythondev | help | the short is I am hitting a few APIs with `requests` that do pagination, and sometimes they give random 502s because their SLA isn't great | 2017-07-11T12:23:28.070805 | Beula | pythondev_help_Beula_2017-07-11T12:23:28.070805 | 1,499,775,808.070805 | 84,717 |
pythondev | help | for a second i thought that was a joke class telling people to leave you alone when you were coding | 2017-07-11T12:23:41.078974 | Vita | pythondev_help_Vita_2017-07-11T12:23:41.078974 | 1,499,775,821.078974 | 84,718 |
pythondev | help | I think the `pow` is right <@Gabriele> - the retry count^backoff-factor | 2017-07-11T12:24:21.102703 | Beula | pythondev_help_Beula_2017-07-11T12:24:21.102703 | 1,499,775,861.102703 | 84,719 |
pythondev | help | is that not the normal way to do it? | 2017-07-11T12:24:27.106567 | Beula | pythondev_help_Beula_2017-07-11T12:24:27.106567 | 1,499,775,867.106567 | 84,720 |
pythondev | help | for my case, it goes from 10s, 21s, 33s | 2017-07-11T12:25:03.128328 | Beula | pythondev_help_Beula_2017-07-11T12:25:03.128328 | 1,499,775,903.128328 | 84,721 |
pythondev | help | hmm, I guess | 2017-07-11T12:26:14.170845 | Gabriele | pythondev_help_Gabriele_2017-07-11T12:26:14.170845 | 1,499,775,974.170845 | 84,722 |
pythondev | help | Nah, I think you are right. 1.1^1, 1.1^2, etc makes sense | 2017-07-11T12:27:26.214854 | Beula | pythondev_help_Beula_2017-07-11T12:27:26.214854 | 1,499,776,046.214854 | 84,723 |
pythondev | help | <@Gabriele> :taco: | 2017-07-11T12:27:39.222424 | Beula | pythondev_help_Beula_2017-07-11T12:27:39.222424 | 1,499,776,059.222424 | 84,724 |
pythondev | help | <@Shelly> :taco: | 2017-07-11T13:18:04.002368 | Signe | pythondev_help_Signe_2017-07-11T13:18:04.002368 | 1,499,779,084.002368 | 84,725 |
pythondev | help | <@Margy> did you get your problem figured out? could you share how you tried to import things? This shouldn’t be a problem | 2017-07-11T13:36:32.643971 | Junita | pythondev_help_Junita_2017-07-11T13:36:32.643971 | 1,499,780,192.643971 | 84,726 |
pythondev | help | <https://github.com/h2non/riprova> | 2017-07-11T14:08:55.804644 | Suellen | pythondev_help_Suellen_2017-07-11T14:08:55.804644 | 1,499,782,135.804644 | 84,727 |
pythondev | help | <@Beula> | 2017-07-11T14:09:10.812950 | Suellen | pythondev_help_Suellen_2017-07-11T14:09:10.812950 | 1,499,782,150.81295 | 84,728 |
pythondev | help | ooh, that’s neat | 2017-07-11T14:09:33.825952 | Junita | pythondev_help_Junita_2017-07-11T14:09:33.825952 | 1,499,782,173.825952 | 84,729 |
pythondev | help | Thanks <@Suellen> - I'll take a gander. Looks pretty neat, and likely that I could just define a nested function to make sure the state is kept correctly across paged requests | 2017-07-11T14:11:07.880712 | Beula | pythondev_help_Beula_2017-07-11T14:11:07.880712 | 1,499,782,267.880712 | 84,730 |
pythondev | help | Oh man, that lib showed me `pook`, which looks pretty awesome for testing | 2017-07-11T14:13:49.973763 | Beula | pythondev_help_Beula_2017-07-11T14:13:49.973763 | 1,499,782,429.973763 | 84,731 |
pythondev | help | <@Junita> I did more research on my problem. It seems on Mac/Windows, Python enforces case-sensitivity with import at compilation. Because I run Debian in Docker on Mac, Python does not enforce case-sensitivity (it's Debian) but the filesystem is not case sensitive, so import does not distinguish cases. One of my dependencies uses `queue`, which internally imports `Queue`. Without case-sensitivity, it causes circular import, where `queue` imports itself. There are others reporting this type of issue: <https://forums.docker.com/t/python-import-source-files-from-docker-volumns-can-not-distinct-upper-lower-cases-in-lib-name/20527> . I worked around this with a very ugly hack, by appending the path of `Queue` at the front of `sys.path` right before a call that results in `queue` getting imported, and then I delete the path from `sys.path` after. I only need this for development so it seems to be OK. | 2017-07-11T14:19:39.179392 | Margy | pythondev_help_Margy_2017-07-11T14:19:39.179392 | 1,499,782,779.179392 | 84,732 |
pythondev | help | I’d be shocked if there’s a case mistake in the python standard library. It was Queue in Python 2, and is queue in Python 3 - are you sure perhaps it’s not an issue of the python version? | 2017-07-11T14:22:25.275450 | Junita | pythondev_help_Junita_2017-07-11T14:22:25.275450 | 1,499,782,945.27545 | 84,733 |
pythondev | help | Looks like there is some platform-specific case-handling behavior (PEP 235) and it predates things like Docker, so maybe it's not surprising it gets confused | 2017-07-11T14:27:43.460713 | Gabriele | pythondev_help_Gabriele_2017-07-11T14:27:43.460713 | 1,499,783,263.460713 | 84,734 |
pythondev | help | Right but the general issue for people using Docker on Mac is that it’s “Linux” so the file system isn’t case-sensitive. This isn’t so much a Docker issue as an issue of people being exposed to a case-sensitive file-system | 2017-07-11T14:28:46.498175 | Junita | pythondev_help_Junita_2017-07-11T14:28:46.498175 | 1,499,783,326.498175 | 84,735 |
pythondev | help | I think the `queue` is for backwards compatibility for 3 to 2 | 2017-07-11T14:29:02.507508 | Margy | pythondev_help_Margy_2017-07-11T14:29:02.507508 | 1,499,783,342.507508 | 84,736 |
pythondev | help | ```
from __future__ import absolute_import
import sys
__future_module__ = True
if sys.version_info[0] < 3:
from Queue import *
else:
raise ImportError('This package should not be accessible on Python 3. '
'Either you are trying to run from the python-future src folder '
'or your installation of python-future is corrupted.')
``` | 2017-07-11T14:29:12.513449 | Margy | pythondev_help_Margy_2017-07-11T14:29:12.513449 | 1,499,783,352.513449 | 84,737 |
pythondev | help | The import on line 6 is circular without case-sensitivity | 2017-07-11T14:29:54.538694 | Margy | pythondev_help_Margy_2017-07-11T14:29:54.538694 | 1,499,783,394.538694 | 84,738 |
pythondev | help | Well there is a class Queue in the Queue module, maybe that’s messing it up? What happens if you do `from Queue import Queue`? | 2017-07-11T14:30:51.572752 | Junita | pythondev_help_Junita_2017-07-11T14:30:51.572752 | 1,499,783,451.572752 | 84,739 |
pythondev | help | The issue was, that small piece of code tries to import `Queue`, while it itself is `queue`, which effectively allows code to import python2 `Queue` even though they refer to python3 `queue` | 2017-07-11T14:33:17.659090 | Margy | pythondev_help_Margy_2017-07-11T14:33:17.659090 | 1,499,783,597.65909 | 84,740 |
pythondev | help | But it broke without case-sensitivity | 2017-07-11T14:33:37.670689 | Margy | pythondev_help_Margy_2017-07-11T14:33:37.670689 | 1,499,783,617.670689 | 84,741 |
pythondev | help | The actualy implementation of `Queue` is perfectly fine | 2017-07-11T14:33:50.678523 | Margy | pythondev_help_Margy_2017-07-11T14:33:50.678523 | 1,499,783,630.678523 | 84,742 |
pythondev | help | oh - is your python file itself named queue.py? | 2017-07-11T14:36:25.768785 | Junita | pythondev_help_Junita_2017-07-11T14:36:25.768785 | 1,499,783,785.768785 | 84,743 |
pythondev | help | There is a queue module (basically the code I pasted), I think it's a dependency from another package | 2017-07-11T14:41:32.943991 | Margy | pythondev_help_Margy_2017-07-11T14:41:32.943991 | 1,499,784,092.943991 | 84,744 |
pythondev | help | Probably just to bridge python 3 and 2 | 2017-07-11T14:42:02.960924 | Margy | pythondev_help_Margy_2017-07-11T14:42:02.960924 | 1,499,784,122.960924 | 84,745 |
pythondev | help | Following instructions from <https://docs.pytest.org/en/latest/getting-started.html> | 2017-07-11T15:58:12.482558 | Noemi | pythondev_help_Noemi_2017-07-11T15:58:12.482558 | 1,499,788,692.482558 | 84,746 |
pythondev | help | Without looking it up, I believe fcntl is a Linux only library. | 2017-07-11T16:50:03.178895 | Meghan | pythondev_help_Meghan_2017-07-11T16:50:03.178895 | 1,499,791,803.178895 | 84,747 |
pythondev | help | ```NAME
fcntl
MODULE REFERENCE
<https://docs.python.org/3.6/library/fcntl>
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
DESCRIPTION
This module performs file control and I/O control on file
descriptors. It is an interface to the fcntl() and ioctl() Unix
routines. File descriptors can be obtained with the fileno() method of
a file or socket object.
``` | 2017-07-11T16:50:57.209068 | Meghan | pythondev_help_Meghan_2017-07-11T16:50:57.209068 | 1,499,791,857.209068 | 84,748 |
pythondev | help | <@Meghan> yeah that is consistent with what I'm seeing after some further reading, but why would that happen when following the Windows instructions? | 2017-07-11T17:05:32.676975 | Noemi | pythondev_help_Noemi_2017-07-11T17:05:32.676975 | 1,499,792,732.676975 | 84,749 |
pythondev | help | <@Noemi> can you link the instructions you are following? | 2017-07-11T17:13:32.910116 | Patty | pythondev_help_Patty_2017-07-11T17:13:32.910116 | 1,499,793,212.910116 | 84,750 |
pythondev | help | <https://docs.pytest.org/en/latest/getting-started.html> | 2017-07-11T17:45:25.768689 | Noemi | pythondev_help_Noemi_2017-07-11T17:45:25.768689 | 1,499,795,125.768689 | 84,751 |
pythondev | help | Hmm. But pip was happy when you ran the install? | 2017-07-11T18:00:25.138155 | Patty | pythondev_help_Patty_2017-07-11T18:00:25.138155 | 1,499,796,025.138155 | 84,752 |
pythondev | help | Hey, I've been working with python lately, and I think I have most of the basic stuff down, but I'm kinda lost as to where to go moving forward, and so I wanted to ask if there was any advice for going 'beyond the basics', and really getting confident with python and everything it has to offer. Thanks! | 2017-07-11T18:18:49.536958 | Elena | pythondev_help_Elena_2017-07-11T18:18:49.536958 | 1,499,797,129.536958 | 84,753 |
pythondev | help | Build something with it! | 2017-07-11T18:20:27.569313 | Beula | pythondev_help_Beula_2017-07-11T18:20:27.569313 | 1,499,797,227.569313 | 84,754 |
pythondev | help | doesn’t sirbot have a command for what’s next? | 2017-07-11T18:20:39.573750 | Johana | pythondev_help_Johana_2017-07-11T18:20:39.573750 | 1,499,797,239.57375 | 84,755 |
pythondev | help | nice <@Elena> :point_up: | 2017-07-11T18:20:59.580483 | Johana | pythondev_help_Johana_2017-07-11T18:20:59.580483 | 1,499,797,259.580483 | 84,756 |
pythondev | help | It's `/file <name>` | 2017-07-11T18:22:19.607127 | Beula | pythondev_help_Beula_2017-07-11T18:22:19.607127 | 1,499,797,339.607127 | 84,757 |
pythondev | help | ah ok | 2017-07-11T18:22:27.609985 | Johana | pythondev_help_Johana_2017-07-11T18:22:27.609985 | 1,499,797,347.609985 | 84,758 |
pythondev | help | Is the interpreter set up right? | 2017-07-11T18:50:30.141417 | Beula | pythondev_help_Beula_2017-07-11T18:50:30.141417 | 1,499,799,030.141417 | 84,759 |
pythondev | help | yeah. I'm restarting the IDE | 2017-07-11T18:51:50.165591 | Mariano | pythondev_help_Mariano_2017-07-11T18:51:50.165591 | 1,499,799,110.165591 | 84,760 |
pythondev | help | pycharm can't handle my code :100: | 2017-07-11T18:52:28.176956 | Mariano | pythondev_help_Mariano_2017-07-11T18:52:28.176956 | 1,499,799,148.176956 | 84,761 |
pythondev | help | too good for it. | 2017-07-11T18:52:39.180422 | Mariano | pythondev_help_Mariano_2017-07-11T18:52:39.180422 | 1,499,799,159.180422 | 84,762 |
pythondev | help | Haha, woot | 2017-07-11T18:53:02.187149 | Beula | pythondev_help_Beula_2017-07-11T18:53:02.187149 | 1,499,799,182.187149 | 84,763 |
pythondev | help | :dagger_knife: | 2017-07-11T18:53:42.199330 | Beula | pythondev_help_Beula_2017-07-11T18:53:42.199330 | 1,499,799,222.19933 | 84,764 |
pythondev | help | ha. Missed the `{}` around the json response. It wasn't that wrong | 2017-07-11T18:54:21.210834 | Mariano | pythondev_help_Mariano_2017-07-11T18:54:21.210834 | 1,499,799,261.210834 | 84,765 |
pythondev | help | Haha, yep. I was looking at general structure vs details | 2017-07-11T18:59:17.299699 | Beula | pythondev_help_Beula_2017-07-11T18:59:17.299699 | 1,499,799,557.299699 | 84,766 |
pythondev | help | Hi guys! Anyone who knows how to set up queued or delayed mails in django? Kind of like how you do in Laravel | 2017-07-12T04:45:26.170823 | Zackary | pythondev_help_Zackary_2017-07-12T04:45:26.170823 | 1,499,834,726.170823 | 84,767 |
pythondev | help | <@Zackary> have you looked at something like django-celery? | 2017-07-12T05:20:36.003325 | Junita | pythondev_help_Junita_2017-07-12T05:20:36.003325 | 1,499,836,836.003325 | 84,768 |
pythondev | help | <@Junita> No - I will have a look at it. Thanks! | 2017-07-12T07:10:39.303435 | Zackary | pythondev_help_Zackary_2017-07-12T07:10:39.303435 | 1,499,843,439.303435 | 84,769 |
pythondev | help | <@Junita> btw, do you know anything about best practice for using environment vars in Django? It’s very easy with Laravel, pulling the env vars from a .env file… But django doenst seem to do it that way.
So far, I have just placed an env.py file in the root of the project, and imported it into my settings.py. | 2017-07-12T07:11:43.323504 | Zackary | pythondev_help_Zackary_2017-07-12T07:11:43.323504 | 1,499,843,503.323504 | 84,770 |
pythondev | help | yeah I actually wrote a little tool to simplify doing that in my python projects: <https://github.com/jimjkelly/yaep> | 2017-07-12T07:12:55.345178 | Junita | pythondev_help_Junita_2017-07-12T07:12:55.345178 | 1,499,843,575.345178 | 84,771 |
pythondev | help | but the basics if you don’t want anything fancy is just `os.getenv(KEY, default)` | 2017-07-12T07:13:59.364285 | Junita | pythondev_help_Junita_2017-07-12T07:13:59.364285 | 1,499,843,639.364285 | 84,772 |
pythondev | help | oh, and loading the `.env` file I suppose | 2017-07-12T07:14:15.369222 | Junita | pythondev_help_Junita_2017-07-12T07:14:15.369222 | 1,499,843,655.369222 | 84,773 |
pythondev | help | Okay, thanks <@Junita> | 2017-07-12T07:56:11.150223 | Zackary | pythondev_help_Zackary_2017-07-12T07:56:11.150223 | 1,499,846,171.150223 | 84,774 |
pythondev | help | Yeah, pip was happy, confirmed that all of my dependencies are there too. I am puzzled | 2017-07-12T08:56:28.567600 | Noemi | pythondev_help_Noemi_2017-07-12T08:56:28.567600 | 1,499,849,788.5676 | 84,775 |
pythondev | help | I'm using Flask and have fallen victim to the surprisingly common circular dependency issue. Do I pretty much have to use an app factory pattern to get around this? | 2017-07-12T09:19:52.273496 | Thomasina | pythondev_help_Thomasina_2017-07-12T09:19:52.273496 | 1,499,851,192.273496 | 84,776 |
pythondev | help | <@Thomasina> pretty much, if you have source to look at we may be able to suggest something else, but my guess is the factory is the simplest way | 2017-07-12T09:22:30.356682 | Beula | pythondev_help_Beula_2017-07-12T09:22:30.356682 | 1,499,851,350.356682 | 84,777 |
pythondev | help | I also found that it helped to avoid various flask extensions, because they would usually mean dragging in a further dependency on the `app` object to implement whatever behavior the extension added | 2017-07-12T09:26:16.477415 | Gabriele | pythondev_help_Gabriele_2017-07-12T09:26:16.477415 | 1,499,851,576.477415 | 84,778 |
pythondev | help | <@Thomasina> Here is a sample app we deprecated from <#C2FMLUBEU|community_projects> - <https://github.com/pyslackers/website-old> | 2017-07-12T09:31:42.657953 | Beula | pythondev_help_Beula_2017-07-12T09:31:42.657953 | 1,499,851,902.657953 | 84,779 |
pythondev | help | <@Beula> Well, my current code works, _but_ I'm making use of `from models import *` and using any other method of import fails. I heard that importing like that should generally always be avoided though. I'm not entirely sure why that is (yet) so I'm not sure if it's worth fussing over or if I might as well continue with it as is. | 2017-07-12T09:34:25.750136 | Thomasina | pythondev_help_Thomasina_2017-07-12T09:34:25.750136 | 1,499,852,065.750136 | 84,780 |
pythondev | help | <@Gabriele> I'm using several Flask extensions, but I suppose the issue in this case comes from Flask-SQLAlchemy specifically. I'm wondering why the extensions exist if they're so prone to these problems though? Is the user just expected to use an app factory pattern? I'm surprised that even the most basic Flask tutorials seem to have this issue. The first tutorial I ever did wouldn't run due to a circular import error, even though the tutorial didn't mention any error and seemed to produce the correct results of the app running as if there was no error. | 2017-07-12T09:36:36.825383 | Thomasina | pythondev_help_Thomasina_2017-07-12T09:36:36.825383 | 1,499,852,196.825383 | 84,781 |
pythondev | help | It's discouraged because it pollutes the namespace with everything from `models` | 2017-07-12T09:37:02.840233 | Beula | pythondev_help_Beula_2017-07-12T09:37:02.840233 | 1,499,852,222.840233 | 84,782 |
pythondev | help | Including its imports | 2017-07-12T09:37:08.843230 | Beula | pythondev_help_Beula_2017-07-12T09:37:08.843230 | 1,499,852,228.84323 | 84,783 |
pythondev | help | All I can say is that I stripped Flask-SQLAlchemy out for exactly this reason. Other people managed to coerce it into working. :slightly_smiling_face: | 2017-07-12T09:37:08.843600 | Gabriele | pythondev_help_Gabriele_2017-07-12T09:37:08.843600 | 1,499,852,228.8436 | 84,784 |
pythondev | help | for example:
```
# module a.py
import secrets
def do_thing():
pass
# module b.py
from a import *
locals() # will have do_thing and secrets available...!
``` | 2017-07-12T09:38:37.894236 | Beula | pythondev_help_Beula_2017-07-12T09:38:37.894236 | 1,499,852,317.894236 | 84,785 |
pythondev | help | <@Gabriele> To be frank the reason I'm using the extension is because it seemed a lot more straightforward to use than SQLAlchemy by itself. Guess I'll have to choose between app factory and that. | 2017-07-12T09:38:57.905445 | Thomasina | pythondev_help_Thomasina_2017-07-12T09:38:57.905445 | 1,499,852,337.905445 | 84,786 |
pythondev | help | Any reason you dislike the app factory? I'd say the extension is worth it IMO | 2017-07-12T09:39:25.921315 | Beula | pythondev_help_Beula_2017-07-12T09:39:25.921315 | 1,499,852,365.921315 | 84,787 |
pythondev | help | I have an app factory, and even that didn't solve all my problems, because various functionality likes to have the app at module-level for decorators, etc | 2017-07-12T09:39:30.924040 | Gabriele | pythondev_help_Gabriele_2017-07-12T09:39:30.924040 | 1,499,852,370.92404 | 84,788 |
pythondev | help | <@Beula> Despite being a coder for longer than I'd like to specify, I've never had to implement an app factory pattern, and I'm wondering how much learning there would be. I generally learn pretty quickly but I am on a fairly tight schedule. | 2017-07-12T09:40:38.963691 | Thomasina | pythondev_help_Thomasina_2017-07-12T09:40:38.963691 | 1,499,852,438.963691 | 84,789 |
pythondev | help | It depends on if you need to import the app elsewhere to work with it, I usually avoid that (but sometimes you cant) | 2017-07-12T09:41:06.980182 | Beula | pythondev_help_Beula_2017-07-12T09:41:06.980182 | 1,499,852,466.980182 | 84,790 |
pythondev | help | Also wondering if that is in fact the best move considering what Kylotan said. If implementing the pattern would still leave me with import issues later on...well...it sounds like it could be more efficient to just ditch problematic extensions | 2017-07-12T09:41:36.997665 | Thomasina | pythondev_help_Thomasina_2017-07-12T09:41:36.997665 | 1,499,852,496.997665 | 84,791 |
pythondev | help | In those cases, I use an `init_app` in a module that initializes the top level things that need to be decorated by `@app` | 2017-07-12T09:41:36.997872 | Beula | pythondev_help_Beula_2017-07-12T09:41:36.997872 | 1,499,852,496.997872 | 84,792 |
pythondev | help | I can't say I have had those issues | 2017-07-12T09:41:57.009708 | Beula | pythondev_help_Beula_2017-07-12T09:41:57.009708 | 1,499,852,517.009708 | 84,793 |
pythondev | help | You just need to pass the app around sometimes during the startup/bootstrap phase | 2017-07-12T09:42:09.016685 | Beula | pythondev_help_Beula_2017-07-12T09:42:09.016685 | 1,499,852,529.016685 | 84,794 |
pythondev | help | The app factory is really simple. Giving it the name 'factory' makes it sound like some sort of complex pattern but really it's just a function that returns a thing. | 2017-07-12T09:42:53.041819 | Gabriele | pythondev_help_Gabriele_2017-07-12T09:42:53.041819 | 1,499,852,573.041819 | 84,795 |
pythondev | help | Yeah, I added a link to a thread above <@Thomasina> for reference | 2017-07-12T09:43:44.071767 | Beula | pythondev_help_Beula_2017-07-12T09:43:44.071767 | 1,499,852,624.071767 | 84,796 |
pythondev | help | <@Beula> so to be clear, `init_app` is a method of a module separate from the main module that runs the init code that I'd usually have in my main module, or...? | 2017-07-12T09:44:59.116874 | Thomasina | pythondev_help_Thomasina_2017-07-12T09:44:59.116874 | 1,499,852,699.116874 | 84,797 |
pythondev | help | Yeah, it's simply a way to lazily initialize other things that depend on the app object | 2017-07-12T09:45:44.143323 | Beula | pythondev_help_Beula_2017-07-12T09:45:44.143323 | 1,499,852,744.143323 | 84,798 |
pythondev | help | for example, how I do blueprints: <https://github.com/pyslackers/website-old/blob/master/pyslackers/blueprints/__init__.py#L7> | 2017-07-12T09:46:13.160044 | Beula | pythondev_help_Beula_2017-07-12T09:46:13.160044 | 1,499,852,773.160044 | 84,799 |
pythondev | help | And how I do the external dependencies (extensions): <https://github.com/pyslackers/website-old/blob/master/pyslackers/external.py#L28> | 2017-07-12T09:46:39.175556 | Beula | pythondev_help_Beula_2017-07-12T09:46:39.175556 | 1,499,852,799.175556 | 84,800 |
pythondev | help | Yes, blueprints. I see most Flask-based projects on GitHub use these but I'm not using them _at all_. I think I'm probably missing something here. | 2017-07-12T09:46:49.181537 | Thomasina | pythondev_help_Thomasina_2017-07-12T09:46:49.181537 | 1,499,852,809.181537 | 84,801 |
pythondev | help | blueprints help you keep the `app` out of most of your files | 2017-07-12T09:47:21.200566 | Gabriele | pythondev_help_Gabriele_2017-07-12T09:47:21.200566 | 1,499,852,841.200566 | 84,802 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.